from flickrapi import FlickrAPI from flickr import MikeFlickr flickrAPIKey = open("/home/mike/flickr.key", "r").read() flickrSecret = open("/home/mike/flickr.secret", "r").read() fapi = None fapi = FlickrAPI(flickrAPIKey, flickrSecret) if len(sys.argv) < 2: print "usage: %s JPEG [JPEG]" % sys.argv[0] sys.exit(-1) token = fapi.getToken(browser="lynx") ##,perms="delete") mikeapi = MikeFlickr(fapi, flickrAPIKey, token) ## methods def userinput(prompt): rtn = "" while len(rtn) == 0: rtn = raw_input(prompt).strip() return rtn ## ## now, upload everything on the command line (unless we have already ## backed it up) ##
from flickrapi import FlickrAPI from flickr import MikeFlickr flickrAPIKey = open("/home/mike/flickr.key", "r").read() flickrSecret = open("/home/mike/flickr.secret", "r").read() fapi = None fapi = FlickrAPI(flickrAPIKey, flickrSecret) if len(sys.argv) < 2: print "usage: %s JPEG [JPEG]" % sys.argv[0] sys.exit(-1) token = fapi.getToken(browser="lynx") mikeapi = MikeFlickr(fapi, flickrAPIKey, token) ## ## first get info from Flickr on what I've already backed up, by the ## "mikebackup" tag ## existing = mikeapi.imagesByTag("mikebackup", privateOnly=True) print "got", len(existing), "existing photos." names = map(lambda x: x[1].lower(), existing) # print names[:10] ## ## now, upload everything on the command line (unless we have already ## backed it up)