Skip to content

Instantly share code, notes, and snippets.

@aditideokar93
Created May 14, 2020 02:06
Show Gist options
  • Save aditideokar93/974ecc970461d60c73f47a748dbacf22 to your computer and use it in GitHub Desktop.
Save aditideokar93/974ecc970461d60c73f47a748dbacf22 to your computer and use it in GitHub Desktop.
Fetch tweetids using snscrape
__author__ = "Aditi Doekar"
import os
politicians=['SpeakerPelosi','SenatorMenendez','SenStabenow','SenatorTester','SenWhitehouse','SenatorDurbin']
for speaker in politicians:
os.system("snscrape --max-results 700 twitter-user "+speaker+" >D:\sns_scraper_tweet_recovery\\tweet_ids\\twitter-"+speaker)
"""
sample filename= twitter-SpeakerPelosi.txt
This file will contain the html links to the tweets fetched. eg.https://twitter.com/SpeakerPelosi/status/1259595056564047876
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment