-
Here, we make use of snscrape to scrape tweets associated with a particular hashtag. Snscrape is a python library that scrapes twitter without the use of API keys.
-
We have 2 scripts associated with this project one to fetch tweets with snscrape and store it in the database (we use SQLite3), and the other script displays the tweets from the database.
-
Using snscrape, we are storing the hashtag, the tweet content, user id, as well as the URL of the tweets in the database.
Packages associated can be installed as:
$ pip install -r requirements.txt
For running the script which fetches tweets and other info associated with the hashtag and storing in the database:
$ python fetch_hashtags.py
For running the script to display the tweet info stored in the database:
$ python display_hashtags.py
fetch_hashtags.py
will work as follows:
display_hashtags.py
will work as follows: