Пример #1
0
    def check_feed(cls):
        """ Return a generator over the latest 40 uploads to PyPI

        by querying an RSS feed.
        """

        url = "https://pypi.org/rss/updates.xml"

        try:
            response = cls.call_url(url)
        except Exception:  # pragma: no cover
            raise AnityaPluginException("Could not contact %s" % url)

        try:
            parser = xml2dict.XML2Dict()
            data = parser.fromstring(response.text)
        except Exception:  # pragma: no cover
            raise AnityaPluginException("No XML returned by %s" % url)

        items = data["rss"]["channel"]["item"]
        for entry in items:
            title = entry["title"]["value"]
            name, version = title.rsplit(None, 1)
            homepage = "https://pypi.org/project/%s/" % name
            yield name, homepage, cls.name, version
Пример #2
0
    def check_feed(cls):
        ''' Return a generator over the latest 40 uploads to PyPI

        by querying an RSS feed.
        '''

        url = 'https://pypi.org/rss/updates.xml'

        try:
            response = cls.call_url(url)
        except Exception:  # pragma: no cover
            raise AnityaPluginException('Could not contact %s' % url)

        try:
            parser = xml2dict.XML2Dict()
            data = parser.fromstring(response.text)
        except Exception:  # pragma: no cover
            raise AnityaPluginException('No XML returned by %s' % url)

        items = data['rss']['channel']['item']
        for entry in items:
            title = entry['title']['value']
            name, version = title.rsplit(None, 1)
            homepage = 'https://pypi.org/project/%s/' % name
            yield name, homepage, cls.name, version
Пример #3
0
    def check_feed(cls):
        ''' Return a generator over the latest 10 uploads to PEAR

        by querying an RSS feed.
        '''

        url = 'https://pear.php.net/feeds/latest.rss'

        try:
            response = cls.call_url(url)
        except Exception:  # pragma: no cover
            raise AnityaPluginException('Could not contact %s' % url)

        try:
            parser = xml2dict.XML2Dict()
            data = parser.fromstring(response.text)
        except Exception:  # pragma: no cover
            raise AnityaPluginException('No XML returned by %s' % url)

        items = data['RDF']['item']
        for entry in items:
            title = entry['title']['value']
            name, version = title.rsplit(None, 1)
            homepage = 'http://pear.php.net/package/%s' % name
            yield name, homepage, cls.name, version
Пример #4
0
    def check_feed(cls):
        """ Return a generator over the latest 10 uploads to PEAR

        by querying an RSS feed.
        """

        url = "https://pear.php.net/feeds/latest.rss"

        try:
            response = cls.call_url(url)
        except Exception:  # pragma: no cover
            raise AnityaPluginException("Could not contact %s" % url)

        try:
            parser = xml2dict.XML2Dict()
            data = parser.fromstring(response.text)
        except Exception:  # pragma: no cover
            raise AnityaPluginException("No XML returned by %s" % url)

        items = data["RDF"]["item"]
        for entry in items:
            title = entry["title"]["value"]
            name, version = title.rsplit(None, 1)
            homepage = "https://pear.php.net/package/%s" % name
            yield name, homepage, cls.name, version
Пример #5
0
    def check_feed(cls):
        ''' Return a generator over the latest uploads to CPAN

        by querying an RSS feed.
        '''

        url = 'http://search.cpan.org/uploads.rdf'

        try:
            response = cls.call_url(url)
        except Exception:  # pragma: no cover
            raise AnityaPluginException('Could not contact %s' % url)

        try:
            parser = xml2dict.XML2Dict()
            data = parser.fromstring(response.text)
        except Exception:  # pragma: no cover
            raise AnityaPluginException('No XML returned by %s' % url)

        items = data['RDF']['item']
        for entry in items:
            title = entry['title']['value']
            name, version = title.rsplit('-', 1)
            #homepage = entry['link']['value'].rsplit('-', 1)[0] + '/'
            homepage = 'http://search.cpan.org/dist/%s/' % name
            yield name, homepage, cls.name, version