auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET) auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET) api = tweepy.API(auth) ##working script to favorite all of Xxxx’s tweets for tweet in api.user_timeline(screen_name = “Xxxx”,count=10,include_rts=False): idstrtweet = str(tweet.id_str) try: api.create_favorite(idstrtweet) except: pass