Vizible’s Blog

Python – How to use Flickr API?

Posted in Python by wearetherock on July 11, 2009
# use
# API key get from flickr web site

import flickrapi
class Uploader :
	def __init__(self, apiKey, secretKey) : = flickrapi.FlickrAPI(apiKey, secretKey)
		(token, frob) ='write')
		if not token: raw_input("Press ENTER after you authorized this program"), frob))

	def showProgress(self, progress, done) :
		if done :
			print 'Done uploading'
		else :
			print 'At %s%%' % progress

	def upload(self, image): = image, callback = self.showProgress)

if __name__ == '__main__' :
	apiKey = 'xxxx'
	secretKey = 'xxxx'
	uploader = Uploader(apiKey, secretKey)
	image = 'into_the_wild.png'
Tagged with: ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: