perceval/backends/core/groupsio.py
def subscriptions(self, per_page=PER_PAGE):
        """Fetch the groupsio paginated subscriptions for a given token

        :param per_page: number of subscriptions per page

        :returns: an iterator of subscriptions
        """
        url = urijoin(GROUPSIO_API_URL, self.GET_SUBSCRIPTIONS)
        logger.debug("Get groupsio paginated subscriptions from " + url)

        keep_fetching = True
        payload = {
            "limit": per_page
        }

        while keep_fetching:
            r = self.__fetch(url, payload)
            response_raw = r.json()
            subscriptions = response_raw['data']
            yield subscriptions

            total_subscriptions = response_raw['total_count']
            logger.debug("Subscriptions: %i/%i" % (response_raw['end_item'], total_subscriptions))

            payload['page_token'] = response_raw['next_page_token']
            keep_fetching = response_raw['has_more']
def subscriptions(self, per_page=PER_PAGE):
        url = urijoin(GROUPSIO_API_URL, self.GET_SUBSCRIPTIONS)
        logger.debug("Get groupsio paginated subscriptions from " + url)

        keep_fetching = True
        payload = {
            "limit": per_page
        }

        while keep_fetching:
            r = self.__fetch(url, payload)
            response_raw = r.json()
            subscriptions = response_raw['data']
            yield subscriptions

            total_subscriptions = response_raw['total_count']
            logger.debug("Subscriptions: %i/%i" % (response_raw['end_item'], total_subscriptions))

            payload['page_token'] = response_raw['next_page_token']
            keep_fetching = response_raw['has_more']
def subscriptions ( self , per_page = PER_PAGE ) : url = urijoin ( GROUPSIO_API_URL , self . GET_SUBSCRIPTIONS ) logger . debug ( "Get groupsio paginated subscriptions from " + url ) keep_fetching = True payload = { "limit" : per_page } while keep_fetching : r = self . __fetch ( url , payload ) response_raw = r . json ( ) subscriptions = response_raw [ 'data' ] yield subscriptions total_subscriptions = response_raw [ 'total_count' ] logger . debug ( "Subscriptions: %i/%i" % ( response_raw [ 'end_item' ] , total_subscriptions ) ) payload [ 'page_token' ] = response_raw [ 'next_page_token' ] keep_fetching = response_raw [ 'has_more' ]
Fetch the groupsio paginated subscriptions for a given token

        :param per_page: number of subscriptions per page

        :returns: an iterator of subscriptions
Fetch the groupsio paginated subscriptions for a given token