Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from twython import Twython
- import glob
- import random
- app_key = "XXX"
- app_secret = "XXX"
- oauth_token = "XXX"
- oauth_token_secret = "XXX"
- twitter = Twython(app_key, app_secret, oauth_token, oauth_token_secret)
- def RandomImageTwitt(folder):
- #Takes the folder where your images are as the input
- images = glob.glob(folder + "*")
- image_open = open(images[random.randint(0,len(images))-1])
- twitter.update_status_with_media(media=image_open)
- RandomImageTwitt("/home/XXX/.reddit-twitter-image/XXX/")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement