Skip to content

Instantly share code, notes, and snippets.

@zepadovani
Created April 10, 2023 19:27
Show Gist options
  • Save zepadovani/7bb0abab3703a8527f334fd4f5c11346 to your computer and use it in GitHub Desktop.
Save zepadovani/7bb0abab3703a8527f334fd4f5c11346 to your computer and use it in GitHub Desktop.
import snscrape.modules.twitter as sntwitter
trecho_do_palindromo = "marrocos"
palindromos = []
for i,tweet in enumerate(sntwitter.TwitterSearchScraper(f'#palindromo + {trecho_do_palindromo}').get_items()):
if i>100:
break
palindromos.append([tweet.date, "@"+tweet.user.username, tweet.rawContent])
for p in palindromos:
print('['+p[0].strftime("%m/%d/%Y, %H:%M:%S")+'] ' + p[1] + ': ' + p[2])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment