Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.70 KB | None | 0 0
  1. # Import Statments
  2. from credentials import*
  3. import tweepy
  4. from time import sleep
  5.  
  6. # Access and authorize Twitter credentials from credentials.py
  7. auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
  8. auth.set_access_token(access_token, access_token_secret)
  9. api = tweepy.API(auth)
  10.  
  11. # Open text file for reading
  12. my_file = open('test.txt', 'r')
  13.  
  14. # Read lines one by one from my_file and assign to file_lines variable
  15. file_lines = my_file.readlines()
  16.  
  17. # Close file
  18. my_file.close()
  19.  
  20. #while running loop
  21. running=1;
  22. while(running):    
  23.     # For loop to iterate over file_lines
  24.     for i in range(0,10):
  25.         api.update_status(i)
  26.         # Sleep to space tweets 5 seconds apart
  27.         sleep(5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement