twitter_scraper | Scrap real time posts from twitter through the streaming api | REST library
kandi X-RAY | twitter_scraper Summary
kandi X-RAY | twitter_scraper Summary
Scrap real time posts from twitter through the streaming api
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of twitter_scraper
twitter_scraper Key Features
twitter_scraper Examples and Code Snippets
Community Discussions
Trending Discussions on twitter_scraper
QUESTION
Currently I am working Covid-19 sentimental analysis where I am using twitter_scraper for scraping my data. After run following line of code I get an error.
...ANSWER
Answered 2020-Apr-01 at 09:00Pip defaults to installing Python packages to a system directory which requires root access.
Do you have root permissions? If so, please try to run sudo pip install...
.
Otherwise, consider installing the dependency to your home directory instead which doesn't require any special privileges:
QUESTION
I'm building a basic Twitter scraper with Python that I want to run off of my RaspPi 4b on an hourly basis. The script is written and works perfectly when called from the terminal using
...ANSWER
Answered 2020-Jan-04 at 06:29you do not need anything more just do in this way
QUESTION
I have to scrape tweets from Twitter for a specific user (@salvinimi), from January 2018. The issue is that there are a lot of tweets in this range of time, and so I am not able to scrape all the ones I need! I tried multiple solutions:
1) ...ANSWER
Answered 2019-Nov-22 at 14:42Three things for the first issue you encounter:
first of all, every API has its limits and one like Twitter would be expected to monitor its use and eventually stop a user from retrieving data if the user is asking for more than the limits. Trying to overcome the limitations of the API might not be the best idea and might result in being banned from accessing the site or other things (I'm taking guesses here as I don't know what's the policy of Twitter on the matter). That said, the documentation on the library you're using states :
With Twitter's Search API you can only sent 180 Requests every 15 minutes. With a maximum number of 100 tweets per Request this means you can mine for 4 x 180 x 100 = 72.000 tweets per hour. By using TwitterScraper you are not limited by this number but by your internet speed/bandwith and the number of instances of TwitterScraper you are willing to start.
then, the function you're using,
query_tweets_from_user()
has alimit
argument which you can set to an integer. One thing you can try is changing that argument and seeing whether you get what you want or not.finally, if the above does not work, you could be subsetting your time range in two, three ore more subsets if needed, collect the data separately and merge them together afterwards.
The second issue you mention might be due to many different things so I'll just take a broad guess here. For me, either setting pages=100
is too high and by one way or another the program or the API is unable to retrieve the data, or you're trying to look at a hundred pages when there is less than a hundred in pages to look for reality, which results in the program trying to parse an empty document.
QUESTION
I just installed this library that scrapes twitter data: https://github.com/kennethreitz/twitter-scraper
I wanted to find out the library's functions and methods so I can start interacting with the library. I have looked around StackOverflow on this topic and tried the following:
pydoc twitter_scraper
help(twitter_scraper)
dir(twitter_scraper)
imported inspect and ran functions = inspect.getmembers(module, inspect.isfunction)
Of the four things I have tried, I have only gotten an output from the inspect option so far. I am also unsure (excluding inspect) whether these codes should go in the terminal or a scratch file.
Still quite new at this. Thank you so much for reading everybody!
...ANSWER
Answered 2018-Nov-07 at 02:25It seems like this library lacks proper documentation, but the GitHub page provides some usage examples to help you get started.
QUESTION
I'm scraping twitter trying to get the friends/users being followed for a list of twitter users. I'm using tweepy and python 3.6.5 on OSX 10.13. An abbreviated code chunk :
...ANSWER
Answered 2018-Jul-19 at 13:07Any number of things could cause the error to appear, but if the cause is not permanent, then retrying an occasional failed API call could make the script work alright.
According to the Tweepy docs the API client constructor accepts a retry_count
parameter which defaults to 0. Try setting retry_count
to something above 0 and see if your script is able to complete successfully, something like this:
QUESTION
Unclear what's going wrong here. From what I see I have defined the fetched_tweets_filename variable above. I pass in fetched_tweets_filename to the initialization of the instance listener of the StdOutListener class. Receiving the following error:
...ANSWER
Answered 2018-Apr-12 at 03:52Here
def __init__(self, scraped_tweets_filename):
self.fetched_tweets_filename = fetched_tweets_filename
you should have
def __init__(self, scraped_tweets_filename):
self.fetched_tweets_filename = scraped_tweets_filename
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install twitter_scraper
Copy the config.yml.default to config.yml, and fill your twitter application tokens you got from twitter developers.
just type python3 twitter.py, the listener will start to dump corpus in: corpus/<YYYYMMDD_HHMMSS.txt>
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page