Skip to content
Snippets Groups Projects
Commit 73185cf8 authored by Guillaume Di Fatta's avatar Guillaume Di Fatta
Browse files

Upload New File

parent 471b702c
No related branches found
No related tags found
No related merge requests found
main.py 0 → 100644
import snscrape.modules.twitter as sntwitter
import pandas as pd
import datetime as dt
# cool
df = pd.DataFrame(columns=['date', 'tweet'])
limit = 100
for i, tweet in enumerate(sntwitter.TwitterSearchScraper(query=" Metaverse -filter:replies -filter:links -filter:retweets -filter:nativeretweets").get_items()):
if i > limit:
break
if (tweet.lang == "en"):
df2 = {'date': tweet.date.strftime(
"%m/%d/%Y, %H:%M:%S"), 'tweet': tweet.rawContent}
df = pd.concat([df, pd.DataFrame.from_records([df2])])
print(i/limit*100)
df = df.drop_duplicates(subset=["tweet"])
df = df.sort_values(by=["tweet"])
df.to_json("twitter_data.json", orient="split")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment