Skip to content

Instantly share code, notes, and snippets.

@0xPr0xy
Created July 25, 2012 18:33
Show Gist options
  • Select an option

  • Save 0xPr0xy/3177756 to your computer and use it in GitHub Desktop.

Select an option

Save 0xPr0xy/3177756 to your computer and use it in GitHub Desktop.
Simple Picasa Class
import gdata.photos.service
import gdata.media
import gdata.geo
import getpass
class Picasa:
def upload(self,filename, title):
gd_client = gdata.photos.service.PhotosService()
gd_client.email = raw_input('Please enter your picasa username:\n')
gd_client.password = getpass.getpass('Password:\n')
gd_client.source = '0xPr0xy_picasa_cli'
gd_client.ProgrammaticLogin()
album_url = '/data/feed/api/user/%s/albumid/default/' % gd_client.email
photo = gd_client.InsertPhotoSimple(album_url, title,'Uploaded using the very lame picasa API :p', filename, content_type='image/jpeg')
print '\nUpload finished...\nPosting to blogger...\n'
return photo.GetMediaURL()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment