Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import types
- api = TumblrAPIv2(CONSUMER_KEY, CONSUMER_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET)
- dirs=os.listdir(directory)
- myArray = []
- for img in dirs:
- img = str(directory + '\\' + img)
- if img.endswith('.gif') or ('.bmp') or ('.jpg') or ('.png') or ('.thm') or ('.tif') or ('.yuv'):
- post = {
- 'type' : 'photo',
- 'data' : img,
- 'tags' : "cute" + ", photo",
- }
- print img
- response = api.createPhotoPost(BLOG,post)
- print "Done!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement