Skip to content
Advertisement

Tag: tweepy

How do I get username on tweepy streamer?

I am using Tweepy.StreamingClient to get some tweets but I am not able to get the username even if I add the filters. I am using the v.4.10.1 of Tweepy Answer Okay I figure it out! I’m using on_tweet that only bring the class Tweet. Tweepy on_tweet Instead I should use on_data that bring all info needed. Tweepy on_data

Python Twitter bot with Tweepy: mentions_timeline() takes 1 positional argument but 2 were given

I’m trying to code a bot for Twitter using Tweepy, and I get this error: mentions_timeline() takes 1 positional argument but 2 were given with this line: mentions = api.mentions_timeline(last_seen_id, tweet_mode = ‘extended’) I can’t take away the last_seen_id, so I don’t know how to resolve this. Answer Tweepy v4.0.0 changed the since_id parameter for API.mentions_timeline to be a keyword-only

KeyError when there exists a key

Using Tweepy, I was trying to live stream the Tweets and save it into database sqlite but as soon as I load the JSON file and store into database the error keeps on occurring saying KeyError : created_at but there already exists a key created_at. I tried with others too, but still the error persists. Here is my code: error

I made a Twitter bot that automatically tweets Direct Messages:

I recently started to learn python, i had 0 knowledge on pyhton, and in the last few weeks i’ve been studying python and the twitter api. I decided to work on a simple twitter bot, that automatically posts whatever people send on my direct messages, and i maneged to do so. Here’s my code: The code works, but not 100%,

Advertisement