Last active
June 19, 2019 16:08
-
-
Save kjaymiller/c6ded95d80de8158290e28c90d3b6a3e to your computer and use it in GitHub Desktop.
Python Monthly Twitter Bot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tweepy | |
from secrets import consumer_key, consumer_secret, access_token, access_token_secret | |
auth = tweepy.OAuthHandler(consumer_key, consumer_secret) | |
auth.set_access_token(access_token, access_token_secret) | |
api = tweepy.API(auth) | |
search = api.search(q="#python lang:en filter:links min_retweets:10", count=10) | |
for tweet in search: | |
result = { | |
'user': tweet.author.screen_name, | |
'text': tweet.text, | |
'url': tweet, | |
'retweets': [retweet.user.screen_name for retweet in tweet.retweets()]} | |
print(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment