DescriptionThis is how the OAuth2Token can be used:
[CODE]
import gdata.gauth
import gdata.client
import gdata.calendar.client
import gdata.calendar.data
token = gdata.gauth.OAuth2Token(client_id='<YOUR_CLIENT_ID>',
client_secret='<YOUR_CLIENT_SECRET>',
scope='https://www.google.com/calendar/feeds',
user_agent='calendar-cmdline-sample/1.0')
uri = token.generate_authorize_url()
print 'Please visit this URL to authorize the application:'
print uri
# Get the verification code from the standard input.
code = raw_input('What is the verification code? ').strip()
token.get_access_token(code)
client = gdata.calendar.client.CalendarClient(token.user_agent)
# Authorize the client.
token.authorize(client)
# Get events feed.
feed = client.GetCalendarEventFeed()
for item in feed.entry:
print item.title.text
[/CODE]
Patch Set 1 #
Total comments: 19
Patch Set 2 : Add support for OAuth 2. #
MessagesTotal messages: 6
|