Created
December 17, 2011 00:56
-
-
Save eyliu/1488731 to your computer and use it in GitHub Desktop.
gdata-python-client example from http://code.google.com/apis/gdata/articles/python_client_lib.html
This file contains 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
# Source: http://code.google.com/apis/gdata/articles/python_client_lib.html | |
import gdata.docs.service | |
import getpass | |
# Create a client class which will make HTTP requests with Google Docs server. | |
client = gdata.docs.service.DocsService() | |
# Authenticate using your Google Docs email address and password. | |
username = raw_input('Google Account (e.g. [email protected]): ') | |
password = getpass.getpass("%s's password: " % username) | |
client.ClientLogin(username, password) | |
# Query the server for an Atom feed containing a list of your documents. | |
documents_feed = client.GetDocumentListFeed() | |
# Loop through the feed and extract each document entry. | |
for document_entry in documents_feed.entry: | |
# Display the title of the document on the command line. | |
print "%s \t %s" % (document_entry.title.text, str(document_entry.author[0])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment