python-twitter从状态获取图像

时间:2012-04-03 06:38:55

标签: python twitter python-twitter

How to get the media url for a particular image from a tweet status.

I am using python-twitter library 0.8. 
statuses = api.GetUserTimeline(count=1, include_entities=True)

Status structure provided by Twitter is 
   status.created_at
    status.created_at_in_seconds # read only
    status.favorited
    status.in_reply_to_screen_name
    status.in_reply_to_user_id
    status.in_reply_to_status_id
    status.truncated
    status.source
    status.id
    status.text
    status.location
    status.relative_created_at # read only
    status.user
    status.urls
    status.user_mentions
    status.hashtags
    status.geo
    status.place
    status.coordinates
    status.contributors

status.text提供了包含图片的eimahe文本和twitter页面网址,但我有兴趣获取图片网址。我在哪里可以得到它?

1 个答案:

答案 0 :(得分:0)

api代码不包含Status对象中的媒体节点元素。我们可以覆盖库或修改和更新库的git repo,以确保Status对象也包含媒体元素。