Skip to content

Instantly share code, notes, and snippets.

@Brittt94
Last active May 21, 2020 11:56
Show Gist options
  • Save Brittt94/c6741d5c8d7b1e68376044a5fb04bd46 to your computer and use it in GitHub Desktop.
Save Brittt94/c6741d5c8d7b1e68376044a5fb04bd46 to your computer and use it in GitHub Desktop.
import pandas as pd
from twitter_scraper import get_tweets
import xlrd
searchquery1 = "@ScottMorrisonMP"
searchquery2 = "@GregHuntMP"
searchquery3 = "@healthgovau"
dataset = []
for searchquery in [searchquery1, searchquery2, searchquery3]:
for tweets in get_tweets(searchquery):
dataset.append(tweets)
print(dataset)
df = pd.DataFrame(dataset)
df.to_excel('BTtwitterdata.xlsx')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment