MichaelCurrin / python-twitter-guide

Code snippets and links to docs around using the Twitter API and Tweepy 🐍 🐦
https://michaelcurrin.github.io/python-twitter-guide/
MIT License
4 stars 8 forks source link

Add engagements #12

Open MichaelCurrin opened 4 years ago

MichaelCurrin commented 4 years ago

How to check if someone is RT or engaged

How to reply/thread.

Links to page on what you can and cannot do.

MichaelCurrin commented 4 years ago

Include a fav or RT loop

search = input("Keyword: ")
total = 500

for tweet in tweepy.Cursor(api.search, search).items(total):
     if tweet.favorited:
        continue
     try:
        tweet.favorite()
        time.sleep(10)
     except tweepy.TweepError as e: 
         print(e.reason)

Error note - list errors and indicate TweepError is not typo.