0

I can't seen to get a list of tweets when calling the get_user_timeline() function. I always get None in return every time.

Maybe I'm not understanding the function but for example when I try calling it for testing in the Python Shell:

>>>from helpers import get_user_timeline
>>>list_tweets = get_user_timeline('@hillaryclinton')
>>>type(list_tweets)
<class 'NoneType'>                       #Get None for every @username

Any help would be appreciated.

3

Try it without the '@' prefix. get_user_timeline calls twitter.lookup_user(). The example in the twitter API doc shows screen_name without the '@' in the example.

| improve this answer | |
  • Thanks, this solve my problem. – tadm123 Jan 2 '17 at 3:51
  • This about drove me insane! Maybe I wasn't reading well but I didn't see that in the instructions. – James Goldstein Feb 13 '17 at 1:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .