
Untitled
By: a guest on
Aug 22nd, 2012 | syntax:
None | size: 1.59 KB | hits: 8 | expires: Never
#!/usr/bin/python
#
# Copyright (C) 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Note:
# This sample demonstrates 2 Legged OAuth using v2 of the Google Data APIs.
# See 2_legged_oauth.py for an example of using 2LO with v1.0 of the APIs.
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app, login_required
from google.appengine.api import users
from xml.etree import ElementTree
import gdata.gauth
import gdata.contacts.client
import gdata.docs.client
CONSUMER_KEY = 'deleted'
CONSUMER_SECRET = 'deleted'
requestor_id = 'deleted'
client = gdata.docs.client.DocsClient(source='gdatatest17')
client.auth_token = gdata.gauth.TwoLeggedOAuthHmacToken(
CONSUMER_KEY, CONSUMER_SECRET, requestor_id)
# Retrieve user's list of Google Docs
feed = client.GetDocList()
for entry in feed.entry:
print entry.title.text
def main():
application = webapp.WSGIApplication([('/', self),],
deabug=True)
run_wsgi_app(application)
if __name__ == '__main__':
main()