Created
July 25, 2012 18:33
-
-
Save 0xPr0xy/3177756 to your computer and use it in GitHub Desktop.
Simple Picasa Class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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