Tweet scraper using a particular hashtag without the intervention of twitter API

  • 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.

  • In this script, we take the input of a hashtag and generate details associated with it (Eg., id, username, date, time, the tweet content, number of replies, likes, retweets, quotes and also its URL) tracing upto the desired number of tweets.

  • We store all this information in a .csv file with the selected file name.

Setup Instructions

Requirements

  1. snscrape library:
computer@computer:~$ pip install snscrape
  1. csv module: It comes built in with python

Working

The inputs user has to give:

image

.csv file generated accordingly:

image

Author

Rohini Rao