Skip to content

Instantly share code, notes, and snippets.

@Lougarou
Last active November 18, 2017 22:56
from random import randint
from time import sleep
from tweepy import OAuthHandler, API
#https://apps.twitter.com/
ACCESS_TOKEN = 'your access token'
ACCESS_SECRET = 'your access secret'
CONSUMER_KEY = 'your consumer key'
CONSUMER_SECRET = 'your consumer secret'
# Initiate the connection to Twitter API
Auth = OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
Auth.set_access_token(ACCESS_TOKEN, ACCESS_SECRET)
TwitterBot = API(Auth)
while True:
message = "Your tweet!"
TwitterBot.update_status(message)
#TwitterBot.update_with_media("image.jpg", status=message)
sleep(randint(3000, 3600)*24) # wait for approximately 1 day
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment