Skip to content
This repository was archived by the owner on Aug 7, 2024. It is now read-only.
This repository was archived by the owner on Aug 7, 2024. It is now read-only.

Problem to retweet et follow someone #402

@alliocha1805

Description

@alliocha1805

Hi all,

I have a script to identify certain tweet (script from issue #395 )

The script works well to identify the Tweets but i have trouble with retweeting/following the person whi posted these tweets

The piece of code (i didn't put the credentials/identification to API etc..) :

results = api.GetSearch(raw_query="q=rt%20follow%20gagner%20lang%3Afr")
    
#Parsing JSON

for elt in results:
    id_tweet = elt.id_str
    screenname = elt.user.screen_name
    print(id_tweet)
    print(screenname)
    #retweet+follow
    twitter.api.Api.PostRetweet(id_tweet, trim_user=True)
    print("retweet : ",id_tweet)
    twitter.api.Api.CreateFriendship(screen_name=screenname)
    print("Follow: ",screen_name)
    #pause
    time.sleep(15)
print("Successful script!")
os.system("PAUSE")

I have the error "TypeError: PostRetweet() missing 1 required positional argument: 'status_id'" with the line of retweet and the error "TypeError: CreateFriendship() missing 1 required positional argument: 'self'" with the line of following .

I think i have missed something in the documentation but i don't see what.

Thanks i advance for your help ;)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions