# evennia.server.portal.rss

RSS parser for Evennia

This connects an RSS feed to an in-game Evennia channel, sending messages to the channel whenever the feed updates.

class `evennia.server.portal.rss.``RSSReader`(factory, url, rate)

  Bases: `evennia.server.session.Session`

  A simple RSS reader using the feedparser module.

  `__init__`(factory, url, rate)

    Initialize the reader.

    Parameters

      - factory (RSSFactory) – The protocol factory.

      - url (str) – The RSS url.

      - rate (int) – The seconds between RSS lookups.

  `get_new`()

    Returns list of new items.

  `disconnect`(reason=None)

    Disconnect from feed.

    Parameters

      reason (str, optional) – Motivation for the disconnect.

  `data_in`(text=None, **kwargs)

    Data RSS -> Evennia.

    Keyword Arguments

      - text (str) – Incoming text

      - kwargs (any) – Options from protocol.

  `update`(init=False)

    Request the latest version of feed.

    Parameters

      init (bool, optional) – If this is an initialization call or not (during init, all entries are conidered new).

    Notes

    This call is done in a separate thread to avoid blocking on slow connections.

class `evennia.server.portal.rss.``RSSBotFactory`(sessionhandler, uid=None, url=None, rate=None)

  Bases: `object`

  Initializes new bots.

  `__init__`(sessionhandler, uid=None, url=None, rate=None)

    Initialize the bot.

    Parameters

      - sessionhandler (PortalSessionHandler) – The main sessionhandler object.

      - uid (int) – User id for the bot.

      - url (str) – The RSS URL.

      - rate (int) – How often for the RSS to request the latest RSS entries.

  `start`()

    Called by portalsessionhandler. Starts the bot.