Question

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 provides th eimahe text and the twitter page url containing image , but i am interested in getting the image url itself. Where can i get that?

Was it helpful?

Solution

The api code doesnt include the media node elements in the Status object. We can override the library or modify and update the git repo for the library to make sure Status object contains the media lements too.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top