tweepy

How to get the replies for a given tweet with tweepy and python?

六月ゝ 毕业季﹏ 提交于 2020-08-23 09:51:00
问题 After some searching I found a way to download the recent tweets from a given user. Now I want to get the replies for each tweet. I know that Twitter API does not provide an endpoint to get replies of a tweet unless we have a premium account. But I could find some workarounds in the internet. I found a way to get few tweets and their replies using Getting tweet replies to a particular tweet from a particular user. This code is also given below. How can I modify my code (getData.py) to save

How to get the replies for a given tweet with tweepy and python?

◇◆丶佛笑我妖孽 提交于 2020-08-23 09:48:10
问题 After some searching I found a way to download the recent tweets from a given user. Now I want to get the replies for each tweet. I know that Twitter API does not provide an endpoint to get replies of a tweet unless we have a premium account. But I could find some workarounds in the internet. I found a way to get few tweets and their replies using Getting tweet replies to a particular tweet from a particular user. This code is also given below. How can I modify my code (getData.py) to save

Get latest direct message from Twitter using python/Tweepy

被刻印的时光 ゝ 提交于 2020-07-22 21:33:08
问题 I've just started using Tweepy and I'm trying to build a pretty simple bot that will use Twitter to automate a few things in my home (mostly for fun and to learn Tweepy). I've gone through the Tweepy docs and can't find out how to retrieve the latest direct message from my own account without knowing the message ID. I'm assuming I can use the API.get_direct_messages() method but it requires a message ID (which I don't know). Can anyone clue me in to the proper way to do this? I'm using

Unable to stop Streaming in tweepy after one minute

|▌冷眼眸甩不掉的悲伤 提交于 2020-07-17 02:29:48
问题 I am trying to stream twitter data for a period of time of say 5 minutes, using the Stream.filter() method. I am storing the retrieved tweets in a JSON file. The problem is I am unable to stop the filter() method from within the program. I need to stop the execution manually. I tried stopping the data based on system time using the time package. I was able to stop writing tweets to the JSON file but the stream method is still going on, but It was not able to continue to the next line of code.

Tweepy: How can I get more than 20 tweets from a user?

♀尐吖头ヾ 提交于 2020-06-16 06:47:30
问题 According to their docs: API.user_timeline([id/user_id/screen_name][, since_id][, max_id][, count][, page]) Returns the 20 most recent statuses posted from the authenticating user or the user specified. It’s also possible to request another user’s timeline via the id parameter. So how can I get more than 20 tweets from a person's timeline? The docs do not show how...Does that user need to be authenticated? 回答1: You can make use of pages parameter in API.user_timeline([id/user_id/screen_name][

How to get number of followers with Tweepy (no pagination)?

我们两清 提交于 2020-06-14 08:12:51
问题 I'm using this function to get all followers from an id: def getAllFollowers(id): followers = tweepy.Cursor(api.followers, id = id) temp = [] for user in followers.items(): temp.append(user) return temp Is there a way to get the number of followers, or friends, tweets, etc... without pagination?? Only the number. 回答1: User objects have followers_count , friends_count and statuses_count attributes for these. See the example response in the Twitter API docs: https://dev.twitter.com/overview/api

Heroku - No web process running

别等时光非礼了梦想. 提交于 2020-06-09 16:57:10
问题 I made a twitter bot using tweepy in Python and tried deploying it using Heroku. The Bot just tweets after certain intervals. After deploying it, the Python program just doesn't run and Heroku log shows the following error : at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=fathomless-island-25537.herokuapp.com request_id=0aa76d12-31e6-4940-85ec-a8476af4f82f fwd="182.64.210.145" dyno= connect= service= status=503 bytes= After looking through some similar

How do I pull tweets from a user for specific dates on python?

て烟熏妆下的殇ゞ 提交于 2020-05-30 08:13:31
问题 I am trying to download tweets from the Reuters (@reuters) twitter account for the month of November 2019. I am using tweepy on python and this is my code: pip install tweepy import tweepy as tw #Keys consumer_key = "..." consumer_secret = "..." access_token = "..." access_token_secret = "..." # Login auth = tw.OAuthHandler(consumer_key, consumer_secret) auth.set_access_token(access_token, access_token_secret) api = tw.API(auth, wait_on_rate_limit=True) #Get user's tweets tweets = tw.Cursor

Rate limit reached. Sleeping for:

左心房为你撑大大i 提交于 2020-05-24 04:13:22
问题 i'm collecting tweets withe thier replies from Twitter's API to build data set and i'm using tweepy library in python for that,but the problem is that I get this error so much (Rate limit reached. Sleeping for:(any number for sec)) that delays me and I have to collect as many data as possible in the shortest time I read that twitter has a rate limit of i think 15 requests per 15 minutes or something like that, but on my situation I can only gather a tweet or two tweet until it stops again and

Find emojis in a tweet as whole clusters and not as individual chars

耗尽温柔 提交于 2020-05-15 22:58:05
问题 So first question I've ever asked on here, and its about emojis. I'm sorry. I am making a twitter bot in python with the help of Tweepy, and regex ( also tried python-pcre ) that will analyse a tweet of a given user, and record the number of times a word or emoji was used. I can do most of this just fine. My problems start with the emojis. I was under the impression that when using \X, (in both regex and python-pcre) will find the eXtended grapheme clusters. Not just the individual ones. I