Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Import Statments
- from credentials import*
- import tweepy
- from time import sleep
- # Access and authorize Twitter credentials from credentials.py
- auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
- auth.set_access_token(access_token, access_token_secret)
- api = tweepy.API(auth)
- # Open text file for reading
- my_file = open('test.txt', 'r')
- # Read lines one by one from my_file and assign to file_lines variable
- file_lines = my_file.readlines()
- # Close file
- my_file.close()
- #while running loop
- running=1;
- while(running):
- # For loop to iterate over file_lines
- for i in range(0,10):
- api.update_status(i)
- # Sleep to space tweets 5 seconds apart
- sleep(5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement