2016-01-31 00:32:02 -05:00
|
|
|
import tweepy, random
|
|
|
|
import sopel.module
|
|
|
|
|
|
|
|
@sopel.module.commands('trump')
|
|
|
|
def trump(bot, trigger):
|
2016-01-31 08:17:59 -05:00
|
|
|
consumer_key = "XXXXXXXXXXXXXXXXXXXXXXXXX"
|
|
|
|
consumer_secret = "XXXXXXXXXXXXXXXXXXXXXXXXX"
|
|
|
|
access_token = "XXXXXXXXXXXXXXXXXXXXXXXXX"
|
|
|
|
access_token_secret = "XXXXXXXXXXXXXXXXXXXXXXXXX"
|
2016-01-31 00:32:02 -05:00
|
|
|
|
|
|
|
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
|
|
|
|
auth.set_access_token(access_token, access_token_secret)
|
|
|
|
|
|
|
|
api = tweepy.API(auth)
|
|
|
|
|
|
|
|
tweets = api.user_timeline(screen_name = 'realDonaldTrump', count = 20, include_rts = False)
|
|
|
|
tweet = random.choice(tweets)
|
|
|
|
bot.say(tweet.text)
|