This is the code and i dont know how to fix this. I am very green here just testing some stuff
-
import tweepy
-
import time
-
api_key = “”
-
api_secret = “”
-
bearer_token = “”
-
access_token = “”
-
access_token_secret = “”
-
client = tweepy.Client(bearer_token, api_key, api_secret, access_token, access_token_secret)
-
auth = tweepy.OAuth1UserHandler(api_key, api_secret, access_token, access_token_secret)
-
api = tweepy.API(auth)
-
class MyStream(tweepy.StreamingClient):
-
def on_tweet(self, tweet):
-
try:
-
print(tweet.text)
-
client.like(tweet.id)
-
except Exception as error:
-
print(error)
-
time.sleep(5)
-
stream = MyStream(bearer_token=bearer_token)
-
stream.add_rules(tweepy.StreamRule(“#Python -is:retweet -is:reply”), dry_run=True)
-
stream.filter()
It looks like you’re using both v1.1 API with api = tweepy.API(auth) and v2 API with client = tweepy.Client - it may be better to remove the redundant v1.1 API stuff and just have the v2 code: Streaming — tweepy 4.10.1 documentation
Yeah i got suspended i used 88 Seconds interval…