planer/experimenting/quicksync.py
def main():
    """Shows basic usage of the Google Calendar API.

    Creates a Google Calendar API service object and outputs a list of the next
    10 events on the user's calendar.
    """
    credentials = get_credentials()
    service = build('calendar', 'v3', http=credentials.authorize(Http()))

    token = get_synctoken()
    if token:
        request = service.events().list(
                calendarId='primary',
                syncToken=token)
    else:
        request = service.events().list(
                calendarId='primary',
                timeMin=(datetime.utcnow() - timedelta(5)).isoformat() + 'Z' # 'Z' indicates UTC time
                )

    while True:
        result = request.execute()
        events = result.get('items', [])
        for event in events:
            pprint(event.get('summary', None))
        pageToken = result.get('nextPageToken', None)
        if not pageToken: break
    put_synctoken(result['nextSyncToken'])
Shows basic usage of the Google Calendar API.

    Creates a Google Calendar API service object and outputs a list of the next
    10 events on the user's calendar.
    
Shows basic usage of the Google Calendar API.
Creates a Google Calendar API service object and outputs a list of the next
10 events on the user's calendar.
Shows basic usage of the Google Calendar API . Creates a Google Calendar API service object and outputs a list of the next 10 events on the user ' s calendar .
def main():
    credentials = get_credentials()
    service = build('calendar', 'v3', http=credentials.authorize(Http()))
    token = get_synctoken()
    if token:
        request = service.events().list(
                calendarId='primary',
                syncToken=token)
    else:
        request = service.events().list(
                calendarId='primary',
                timeMin=(datetime.utcnow() - timedelta(5)).isoformat() + 'Z' 
                )
    while True:
        result = request.execute()
        events = result.get('items', [])
        for event in events:
            pprint(event.get('summary', None))
        pageToken = result.get('nextPageToken', None)
        if not pageToken: break
    put_synctoken(result['nextSyncToken'])
def main ( ) : credentials = get_credentials ( ) service = build ( 'calendar' , 'v3' , http = credentials . authorize ( Http ( ) ) ) token = get_synctoken ( ) if token : request = service . events ( ) . list ( calendarId = 'primary' , syncToken = token ) else : request = service . events ( ) . list ( calendarId = 'primary' , timeMin = ( datetime . utcnow ( ) - timedelta ( 5 ) ) . isoformat ( ) + 'Z' ) while True : result = request . execute ( ) events = result . get ( 'items' , [ ] ) for event in events : pprint ( event . get ( 'summary' , None ) ) pageToken = result . get ( 'nextPageToken' , None ) if not pageToken : break put_synctoken ( result [ 'nextSyncToken' ] )
Shows basic usage of the Google Calendar API.
Shows basic usage of the Google Calendar API .
"""Shows basic usage of the Google Calendar API.

    Creates a Google Calendar API service object and outputs a list of the next
    10 events on the user's calendar.
    """ # 'Z' indicates UTC time