Instagram blocks photo access to Twitter-like clientsMonday, 10 Dec 2012
Unfortunately, we have recently found out that Instagram went a bit further in blocking its photos from appearing in Twitter clients too. We're not sure if this is indeed intentional or otherwise a bug in Instagram's public API, but the cause of this issue is technical and apparently Instagram is blocking user agents that contain the word "Twitter" in the User-Agent string. This means that our Twitter Ticker iOS is no longer able to display Instagram photos and is showing 1 white pixel image instead.
We have found a workaround for this issue and we're preparing an update for TwitterTicker which will solve this issue. We hope this update will be released on AppStore by the end of December 2012.
What we've found out recently is that Instagram is redirecting requests for its images to a white 2x2 pixels GIF image instead of an actual photo if the User-Agent HTTP header field contains the word "Twitter". This means that if you click on an Instagram URL in, for example, Safari browser, you will see the photo but if you use a Twitter app that identifies itself with a word "Twitter" you will see a white 2x2 GIF image instead.
$ curl -sv0 "http://instagram.com/p/TAV00qoef-/media/?size=l" -H "User-Agent: AnythingAtAll" < HTTP/1.1 302 FOUND < Content-Language: en < Content-Type: text/html; charset=utf-8 < Date: Mon, 10 Dec 2012 08:49:17 GMT < Location: http://distilleryimage10.instagram.com/a76f8e0441c711e2880f22000a1f9ca7_7.jpg; < Server: nginx < Vary: Accept-Language, Cookie < Content-Length: 0 < Connection: Close
But this request has word "Twitter" in the User-Agent string, so the redirection is pointing to a bogus image.
$ curl -sv0 "http://instagram.com/p/TAV00qoef-/media/?size=l" -H "User-Agent: AnythingAtAllTwitter" < HTTP/1.1 302 FOUND < Content-Language: en < Content-Type: text/html; charset=utf-8 < Date: Mon, 10 Dec 2012 08:49:24 GMT < Location: http://images.instagram.com/white2x2.gif; < Server: nginx < Vary: Accept-Language, Cookie < Content-Length: 0 < Connection: Close