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)[source]

Bases: evennia.server.session.Session

A simple RSS reader using the feedparser module.

__init__(factory, url, rate)[source]

Initialize the reader.

Parameters
  • factory (RSSFactory) – The protocol factory.

  • url (str) – The RSS url.

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

get_new()[source]

Returns list of new items.

disconnect(reason=None)[source]

Disconnect from feed.

Parameters

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

data_in(text=None, **kwargs)[source]

Data RSS -> Evennia.

Keyword Arguments
  • text (str) – Incoming text

  • kwargs (any) – Options from protocol.

update(init=False)[source]

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)[source]

Bases: object

Initializes new bots.

__init__(sessionhandler, uid=None, url=None, rate=None)[source]

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()[source]

Called by portalsessionhandler. Starts the bot.