Created
May 6, 2012 12:22
-
-
Save mursts/2622012 to your computer and use it in GitHub Desktop.
Google Driveのファイルを取得する
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
#!/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 | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment