Last active
November 18, 2017 22:56
This file contains 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
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