Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. from twython import Twython
  2. import glob
  3. import random
  4.  
  5. app_key = "XXX"
  6. app_secret = "XXX"
  7. oauth_token = "XXX"
  8. oauth_token_secret = "XXX"
  9. twitter = Twython(app_key, app_secret, oauth_token, oauth_token_secret)
  10.  
  11. def RandomImageTwitt(folder):
  12. #Takes the folder where your images are as the input
  13. images = glob.glob(folder + "*")
  14. image_open = open(images[random.randint(0,len(images))-1])
  15. twitter.update_status_with_media(media=image_open)
  16.  
  17. RandomImageTwitt("/home/XXX/.reddit-twitter-image/XXX/")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement