python error in get trending topic using tweepy
Question: I am trying to get top 20 trending topic through twitter api based on the
Tweepy library.

Here is my python code:

    
    
    import tweepy
    import json
    import time
    
    today = time.strftime("%Y-%m-%d")
    
    CONSUMER_KEY = ""
    CONSUMER_SECRET = ""
    
    ACCESS_KEY = ""
    ACCESS_SECRET = ""
    
    auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
    auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)
    api = tweepy.API(auth)
    
    trends = api.trends_daily(today)
    print trends
    

I am using trends_daily function to get the top 20 trending topics for each
day.

The variable "today" is in **date format** : `today =
time.strftime("%Y-%m-%d")`. And I tried string format as well. However, it
keeps report error message:

    
    
    File "/Users/Ivy/PycharmProjects/TwitterTrend/trends.py", line 17, in <module>
        trends = api.trends_daily("2014-06-03")
      File "build/bdist.macosx-10.9-intel/egg/tweepy/binder.py", line 230, in _call
      File "build/bdist.macosx-10.9-intel/egg/tweepy/binder.py", line 203, in execute
    tweepy.error.TweepError: [{u'message': u'Sorry, that page does not exist', u'code': 34}] 
    


Answer: I believe that you're using tweepy version 1 which is [no longer
supported](https://dev.twitter.com/docs/api/1/get/trends/daily):
<https://api.twitter.com/1/trends/daily.json>

Try to re-install (version 1.1), for example:
<https://api.twitter.com/1.1/trends/available.json>

