rss

rss

class platypush.plugins.rss.RssPlugin(subscriptions: Optional[Collection[str]] = None, poll_seconds: int = 300, user_agent: str = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36', **kwargs)[source]

A plugin for parsing and subscribing to RSS feeds.

Triggers:

Requires:

  • feedparser (pip install feedparser)

__init__(subscriptions: Optional[Collection[str]] = None, poll_seconds: int = 300, user_agent: str = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36', **kwargs)[source]
Parameters:
  • subscriptions – List of feeds to monitor for updates, as URLs.

  • poll_seconds – How often we should check for updates (default: 300 seconds).

  • user_agent – Custom user agent to use for the requests.

get_latest_entries(limit: int = 20)[source]

Get the latest entries from the subscribed feeds, sorted by descending published date.

Parameters:

limit – Maximum number of entries to return (default: 20).

Returns:

[
  {
    "content": "Feed entry content",
    "feed_title": "Feed title",
    "feed_url": "https://some-website/rss",
    "id": "1234",
    "published": "2022-06-14T14:50:02.091914+00:00",
    "summary": "Feed entry summary",
    "title": "Feed entry title",
    "url": "https://some-website/articles/1234"
  }
]

parse_feed(url: str)[source]

Parse a feed URL.

Parameters:

url – Feed URL.

Returns:

[
  {
    "content": "Feed entry content",
    "feed_title": "Feed title",
    "feed_url": "https://some-website/rss",
    "id": "1234",
    "published": "2022-06-14T14:50:02.091914+00:00",
    "summary": "Feed entry summary",
    "title": "Feed entry title",
    "url": "https://some-website/articles/1234"
  }
]