Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get photos from twitter home timeline API

Tags:

twitter

api

Anyone know if it's possible to grab all posts with an image, from the Twitter API? I know I can check all tweets for a media, but that's a bit slow process.

like image 901
Simon Thomsen Avatar asked Mar 09 '12 15:03

Simon Thomsen


People also ask

How do I find my home timeline on Twitter?

In the top menu, tap the icon. Tap the arrows to switch to the timeline view of your choice, or tap View content preferences to go to your settings. In the top menu, tap the icon. Tap the arrows to switch to the timeline view of your choice, or tap View content preferences to go to your settings.

Is TweetDeck an API?

TweetDeck uses all of the Twitter API functionalities. You can publish Tweets, create collections, send DMs, and more through this web app.


1 Answers

First of all, you need to include include_entities=true as part of the request:

i.e. https://api.twitter.com/1/statuses/user_timeline.json?screen_name=twitter&include_entities=true

Then, look for any media_url elements; those will contain the URL to any photos. It may contain video links, so you'll have to filter for common image types (.png/ .jpg/ .gif/etc).

like image 63
AJit Avatar answered Oct 04 '22 16:10

AJit