I'm using the Twitter Streaming API to get images included in tweets, and show them in my Android app. The media object which represents the image contains a media_url field that is a direct link to the image, and a JSON objects named sizes which contains the different sizes available for that image. The question is, how can I get such resized images? I want to download the thumbnail directly from Twitter, and since the sizes object contains a thumb field it should be possible, but how? I already tried to concat ?size=thumb to the media_url but it didn't work. Media object example:
{"id":897839774635053000,"id_str":"897839774635053056","indices":
[75,98],"media_url":"http://pbs.twimg.com/media/DHXEhKBW0AAKhf3.jpg",
"media_url_https":"https://pbs.twimg.com/media/DHXEhKBW0AAKhf3.jpg",
"url":"https://REMOVED/4NcW6720Zj","display_url":"pic.twitter.com/4NcW6720Zj",
"expanded_url":
"https://twitter.com/darioolly/status/897840123924164608/photo/1",
"type":"photo",
"sizes":{"thumb":{"w":150,"h":150,"resize":"crop"},
"medium":{"w":720,"h":711,"resize":"fit"},
"small":{"w":680,"h":672,"resize":"fit"},
"large":{"w":720,"h":711,"resize":"fit"}}}