[Python] Retrieve retweeters id

Discussão em 'Python' iniciado por Stack, Setembro 5, 2025.

  1. Stack

    Stack Membro Participativo

    I need to retrieve retweeters id using tweepy.

    import tweepy
    import time,json

    APP_KEY=""
    APP_SECRET=""
    OAUTH_TOKEN=""
    OAUTH_TOKEN_SECRET=""

    auth = tweepy.OAuthHandler(APP_KEY,APP_SECRET)
    auth.set_access_token(OAUTH_TOKEN,OAUTH_TOKEN_SECRET)

    api = tweepy.API(auth)
    '''for status in api.user_timeline(screen_name='acmigdtuw',include_rts=1,count=200):
    print status.id'''
    firstTweet = api.user_timeline(screen_name="acmigdtuw")[0]
    print firstTweet.text
    print firstTweet.id
    #results = api.retweets(status.id,cursor=-1,stringify_ids=1)
    pl = api.retweets.id(id=firstTweet.id)
    print pl[0]['user']['screen_name']

    Continue reading...

Compartilhe esta Página