Skip to content

Instantly share code, notes, and snippets.

@mursts
Created May 6, 2012 12:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mursts/2622012 to your computer and use it in GitHub Desktop.
Save mursts/2622012 to your computer and use it in GitHub Desktop.
Google Driveのファイルを取得する
#!/usr/bin/envy python
# coding:utf-8
import sys
from getpass import getpass
import gdata.docs.client
APP_NAME = 'GoogleDocumentAPITest'
SERVICE_NAME = 'writely'
URI = 'https://docs.google.com/feeds/default/private/full/-/mine'
def get_client():
pass
def main():
user_id = raw_input('Enter Google ID: ')
passwd = getpass('Enter Password: ')
client = gdata.docs.client.DocsClient(source=APP_NAME)
client.http_client.debug = False
try:
client.client_login(user_id, passwd, source=APP_NAME, service=SERVICE_NAME)
except gdata.client.Error:
print 'Login Error'
for entry in client.get_resources(uri=URI).entry:
resource = client.get_resource(entry)
print resource.title.text
print resource.resource_id.text
print
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment