question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem to retweet et follow someone

See original GitHub issue

Hi 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:closed
  • Created 7 years ago
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
bearcommented, Nov 3, 2016

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

1reaction
jeremylowcommented, Nov 2, 2016

twitter.api.Api.PostRetweet(id_tweet, trim_user=True) and twitter.api.Api.CreateFriendship(screen_name=screenname) should be api.PostRetweet(id_tweet, trim_user=True) and api.CreateFriendship(screen_name=screenname)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found