Skip to main content

Search a site for RSS feeds

Project description

Feedsearch is a Python library for searching websites for RSS feeds.

It was originally based on Feedfinder2 written by Dan Foreman-Mackey, which in turn is based on feedfinder - originally written by Mark Pilgrim and subsequently maintained by Aaron Swartz until his untimely death.

The main difference with Feedfinder2 is that Feedsearch allows for optional fetching of Feed and Site metadata.


Feedsearch is called with the single function search:

>>> from feedsearch import search
>>> feeds = search('')
>>> feeds
[FeedInfo: <>, FeedInfo: <>]
>>> feeds[0].url

To get Feed and Site metadata:

>>> feeds = search('', info=True)
>>> feeds
>>> pprint(vars(feeds[0]))
{'description': 'Latest Articles and Investigations from ProPublica, an '
                'independent, non-profit newsroom that produces investigative '
                'journalism in the public interest.',
'hub': '',
'is_push': True,
'score': 4,
'site_icon_url': '',
'site_name': 'ProPublica',
'site_url': '',
'title': 'Articles and Investigations - ProPublica',
'url': ''}

Search will always return a list of FeedInfo objects, each of which will always have a url property. Feeds are sorted by the score value from highest to lowest, with a higher score theoretically indicating a more relevant feed, but whatever you do don’t take this seriously.

If you only want the raw urls, then simply use a list comprehension on the result:

>>> feeds
[FeedInfo:, FeedInfo:]
>>> urls = [f.url for f in feeds]
>>> urls
['', '']

In addition to the URL, the search function takes the following optional keyword arguments:

  • info: bool: Get Feed and Site Metadata. Defaults False.

  • check_all: bool: Check all <link> and <a> tags on page. Defaults False.

  • user_agent: str: User-Agent Header string. Defaults to Package name.

  • timeout: int or tuple: Timeout for each request in the search (not a timeout for the search method itself). Defaults to 30 seconds.

  • max_redirects: int: Maximum number of redirects for each request. Defaults to 30.

  • parser: str: BeautifulSoup parser for HTML parsing. Defaults to ‘html.parser’.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

feedsearch-0.0.1.tar.gz (8.2 kB view hashes)

Uploaded source

Built Distribution

feedsearch-0.0.1-py3-none-any.whl (11.8 kB view hashes)

Uploaded 3 6

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page