def _get_google_cal_page(self, calendar_id, sync_token, page_token=None):
        api_key = settings.GOOGLE_CALENDAR_API_KEY
        if page_token is not None:
            param = '&pageToken=%s'%quote(page_token)
        else:
            param = '&syncToken=%s'%quote(sync_token) if sync_token is not None else ''
        url = 'https://content.googleapis.com/calendar/v3/calendars/%s/events?showDeleted=true&singleEvents=true%s&key=%s' % (quote(calendar_id), param, quote(api_key))
        response = urllib2.urlopen(url)
        data = json.load(response)
        self._getLogger().debug(data)
        res = {}
        res['nextSyncToken'] = data['nextSyncToken'] if 'nextSyncToken' in data else None
        res['nextPageToken'] = data['nextPageToken'] if 'nextPageToken' in data else None
        res['items'] = data['items'] if 'items' in data else []
        return res
dataset/ETHPy150Open ofri/Open-Knesset/events/scrapers.py/PersonsEventsScraper._get_google_cal_page/original