TwitterAPI for Python: using result from request in a new request
Question: I want to collect all user data from the followers from a specific twitter
user. First, I collect the user_id's of the followers from the user using
followers/id. Thereafter I want to use users/lookup in order to collect the
user data from the collected user_id's all at once (with a maximum of 100).
This is where I get stuck, I don't seem to get any results. I think it has
something to do with the input user_ids since inputting them manually gives me
the results I expect.

    
    
    from TwitterAPI import TwitterAPI
    import JSON
    
    consumer_key = "..."
    consumer_secret = "..."
    access_token = "..."
    access_token_secret = "..."
    
    api = TwitterAPI(consumer_key, consumer_secret, access_token, access_token_secret)
    
    r = api.request('followers/ids', {'screen_name':'elonmusk'})
    r = json.loads(r.text)
    r = list(r['ids'])
    f = api.request('users/lookup', {'user_id': r })
    print(f.text)
    

I've tried several devious ways to solve it, but the above mentioned is for as
far as my beginner python knowledge ranges the most reliable. Although it does
not work.


Answer: I managed to fix it myself. The first request yielded too many results, which
the second request couldn't process. I changed the first request to this:

    
    
    r = api.request('followers/ids', {'screen_name':'elonmusk', 'count':'100'})
    

