开发者

Getting photos from Twitter statuses/user_timeline

开发者 https://www.devze.com 2023-04-10 10:58 出处:网络
Using the Twitter API, I can get all the user\'s Tweets with location information. If they use a mobile开发者_开发问答 app and attach photos, how can I get this from the API?First of all, you need to

Using the Twitter API, I can get all the user's Tweets with location information. If they use a mobile开发者_开发问答 app and attach photos, how can I get this from the API?


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).

See: Tweet Entities

0

精彩评论

暂无评论...
验证码 换一张
取 消