Problem to retweet et follow someone
See original GitHub issueHi all,
I have a script to identify certain tweet (script from issue https://github.com/bear/python-twitter/issues/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 😉
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (1 by maintainers)
Top Results From Across the Web
Twitter Retweet FAQS – deleting, RTs, and more
Learn the answers to commonly-asked questions about Retweets on Twitter such as how to delete, what RT means, and more.
Read more >How to Allow Someone to Retweet Your Tweets
1. Log in to your Twitter account. Click the "gear" icon in the top right of the screen to activate a drop-down menu....
Read more >What Twitter option prevents others from retweeting my tweets ...
In your Privacy and Safety settings, the first checkbox labeled 'Protect your Tweets' prevents your Tweets from being shared publicly.
Read more >Twitter cannot let me Reply, Tweet or Follow someone
I created my account in 2021 and followed 2 Twitter profile. ... try to follow someone I get popup warning like “You are...
Read more >Why can't I follow people? - Twitter - Aux Mode
You may have hit a follow limit. Twitter has imposed reasonable limits to help prevent system strain and to limit abuse. Read more...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
thanks @alliocha1805 for the original report and sticking with us during debug and testing
it’s great working with devs who don’t just toss an issue and then never hang around
twitter.api.Api.PostRetweet(id_tweet, trim_user=True)
andtwitter.api.Api.CreateFriendship(screen_name=screenname)
should beapi.PostRetweet(id_tweet, trim_user=True)
andapi.CreateFriendship(screen_name=screenname)