Parsing Twitter JSON object in Python

前端 未结 4 1260
一生所求
一生所求 2021-01-07 04:39

I am trying to download tweets from twitter.

I have used python and Tweepy for this. Though I am new to both Python and Twitter API.

My Python script is as f

4条回答
  •  情话喂你
    2021-01-07 05:20

    take my code for tweepy:

    def twitterfeed():
       auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
       auth.set_access_token(access_key, access_secret)
       api = tweepy.API(auth)
       statuses = tweepy.Cursor(api.home_timeline).items(20)
       data = [s.text.encode('utf8') for s in statuses]
       print data
    

提交回复
热议问题