def _extract_metrics(self, page, status_code=200, id=None):
        if status_code != 200:
            if status_code == 404:
                return {}
            else:
                raise(self._get_error(status_code))

        if not provider._count_in_xml(page, 'posts'):
            raise ProviderContentMalformedError

        count = provider._count_in_xml(page, 'post')
        if count:
            metrics_dict = {'citeulike:bookmarks': count}
        else:
            metrics_dict = {}

        return metrics_dict
Beispiel #2
0
    def _extract_metrics(self, page, status_code=200, id=None):
        if status_code != 200:
            if status_code == 404:
                return {}
            else:
                raise (self._get_error(status_code))

        if not provider._count_in_xml(page, 'posts'):
            raise ProviderContentMalformedError

        count = provider._count_in_xml(page, 'post')
        if count:
            metrics_dict = {'citeulike:bookmarks': count}
        else:
            metrics_dict = {}

        return metrics_dict
    def _extract_metrics(self, page, status_code=200, id=None):
        if status_code != 200:
            if status_code == 404:
                return {}
            else:
                raise(self._get_error(status_code))

        if not "<response>" in page:
            raise ProviderContentMalformedError

        count = provider._count_in_xml(page, 'doc')
        if count:
            metrics_dict = {'plossearch:mentions': count}
        else:
            metrics_dict = {}

        return metrics_dict
Beispiel #4
0
    def _extract_metrics(self, page, status_code=200, id=None):
        if status_code != 200:
            if status_code == 404:
                return {}
            else:
                raise (self._get_error(status_code))

        if not "<response>" in page:
            raise ProviderContentMalformedError

        count = provider._count_in_xml(page, 'doc')
        if count:
            metrics_dict = {'plossearch:mentions': count}
        else:
            metrics_dict = {}

        return metrics_dict