Search code examples
apitwittertimestamptweetstwython

getting timestamp of tweets with Twython


I can't find this information anywhere, even if it seems to me a pretty simple task. However no methods nor threads appeared to me while crawling for answers on the web/docs

I'm using Twython to extract tweets, and I need the timestamps or even just the day at which it was posted. Can anyone help me?


Solution

  • All Twython does is wrap the Twitter API, so look at that documentation.

    Here is an example:

    from twython import Twython
    twitter = Twython()
    timeline = twitter.getUserTimeline(screen_name="handle")
    for tweet in timeline:
        print(tweet['created_at'])