Skip to content

Instantly share code, notes, and snippets.

@ColtonPhillips
Created July 22, 2014 11:35
Show Gist options
  • Save ColtonPhillips/88abc83713d5eb23dcec to your computer and use it in GitHub Desktop.
Save ColtonPhillips/88abc83713d5eb23dcec to your computer and use it in GitHub Desktop.
How to tweet dot com
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