Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Basic Twitter Bot
- #By Brandon Hammond
- import os
- import sys
- import time
- import tweepy
- from time import sleep
- x = 60
- #Authenticate with Twitter API
- #Change text in caps to values given by Twitter API
- auth = tweepy.OAuthHandler("CONSUMER KEY", "CONSUMER SECRET")
- auth.set_access_token("ACCESS TOKEN", "ACCESS TOKEN SECRET")
- api = tweepy.API(auth)
- #Open file containing Tweets (Tweets are seperated by new line)
- f = open("tweets.txt", "w")
- while True:
- #Repeat forever
- content = f.readline()
- if content == "":
- #If at end of file
- f.seek(0)
- api.update_status(content)
- else:
- #If still in file
- api.update_status(content)
- sleep(X) #Change X to wanted time in seconds
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement