Advertisement
Guest User

Untitled

a guest
Feb 17th, 2012
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. import types
  2.  
  3. api = TumblrAPIv2(CONSUMER_KEY, CONSUMER_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET)
  4.  
  5. dirs=os.listdir(directory)
  6. myArray = []
  7. for img in dirs:
  8.     img = str(directory + '\\' + img)
  9.     if img.endswith('.gif') or ('.bmp') or ('.jpg') or ('.png') or ('.thm') or ('.tif') or ('.yuv'):
  10.         post = {
  11.  
  12.             'type' : 'photo',
  13.             'data' :  img,
  14.             'tags' : "cute" + ", photo",
  15.             }
  16.         print img
  17.     response = api.createPhotoPost(BLOG,post)
  18.  
  19.  
  20. print "Done!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement