Created
July 22, 2014 11:35
-
-
Save ColtonPhillips/88abc83713d5eb23dcec to your computer and use it in GitHub Desktop.
How to tweet dot com
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 urllib import urlopen | |
from random import randrange | |
from random import choice | |
consumer_key='' | |
consumer_secret='' | |
access_token_key='' | |
access_token_secret='' | |
auth = tweepy.OAuthHandler(consumer_key, consumer_secret) | |
auth.set_access_token(access_token_key, access_token_secret) | |
bot = tweepy.API(auth) | |
with open('my_tweets.txt', 'r') as linkFile: | |
links = linkFile.read().split('\n') | |
tweet = '{link}'.format(link=choice(links)) | |
print(str(tweet)) | |
bot.update_status(tweet) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment