1

The Twitter API documentation for GET users/profile_image/:screen_name states that:

This method should only be used by application developers to lookup or check the profile image URL for a user. This method must not be used as the image source URL presented to users of your application.

This API call returns a 302 redirecting to the profile image url. What is the best practice to make those images available for ones application? The easiest way it seems, would be to use the resulting url string and embbed it in the apps html code (e.g. in the src of an img tag). The alternative would be to store the image locally as a file or in a blob field.

Is linking the image covered by the "must not" or does that mean that you shall not call the API, but you do can use the resulting url?

Steven
  • 113
  • 1
  • 5

1 Answers1

1

In the past, I've simply stored the URL in the database and then reused the url when I needed to present the image.

Pulling down and storing the images is more complex and adds a dependency for access to the stored images on your application.

I'd also recommend that you re-fetch the image url periodically as users change their profile pics sometimes.

The twitter api states:

Once an end user has authenticated via Connect with Twitter, you must clearly display the end user's Twitter identity. Twitter identity includes visible display of the end user's avatar, Twitter user name, and the Twitter "bird" mark. Displays of the end user's followers on your Service must clearly show that the relationship is associated with the Twitter service.

Kevin Bedell
  • 13,254
  • 10
  • 78
  • 114