Skip to content

SW_RSS feed

Rolf Obrecht edited this page Sep 24, 2023 · 8 revisions

News Ticker

In order to use your setup as a news ticker, you have to configure two software parts:

  1. Configure the RSS reader to collect messages from RSS feeds
  2. Configure piTelex for printing the messages collected by the RSS reader

Prerequisites

  1. Install the additionally needed python modules:

    sudo apt install python3-feedparser python3-html2text python3-watchdog

  2. Check that your teleprinter is connected correctly and functional.

RSS reader

The RSS reader reads messages from RSS-feed URL's, formats them to a TTY-compliant format and stores the result to a file.
...piTelex/RSS-feed/newsfeeds.cfg is the default configuration file. Change to this directory and specify the feeds to monitor:

$ cd RSS-feed
$ nano newsfeeds.cfg

Example:

# Identifier    URL                                             Polling interval in seconds (optional, default=10)
#--------------+-----------------------------------------------+--------------------------------------------------                 
# FAZ 		https://www.faz.net/rss/aktuell/

# SZ 		https://rss.sueddeutsche.de/rss/Topthemen/     500
ARD-Tagesschau	https://www.tagesschau.de/xml/rss2             60
Warnmeldungen	https://warnung.bund.de/api31/mowas/rss/053340000000.rss 60

Now you can start and control the RSS reading subsystem using the script rss-feed. If necessary, make it executable first (chmod +x rss-feed).

./rss-feed start should start the reader for all configured feeds, and

./rss-feed status should list the services as running.

RSS printing

Now it's time to setup the last part of the task, i.e. the printing of the collected messages to the teleprinter. This is managed by piTelex' module News. It must be enabled in telex.json and it must be given the path to the files written by the RSS reader:

    "news": {
      "type": "news",
      "enable": true,
      "newspath": "/home/pi/piTelex/RSS-feed/news/"
    },

The top lines of the script rss-feed define some paths for the news subsystem. Change them only if you know what you're doing. In most cases, they can be left at their default values. Be sure to give the News module the identical path as specified in rss-feed script, otherwise News will not be able to find the messages to be printed.

Don't forget to restart piTelex to activate the configuration changes.

Example Printout

ard-tagesschau  22.08.2022 10:25:29

== erneute zinssenkung soll chinas wirtschaft ankurbeln ==
die people's bank of china hat ein weiteres mal zwei ihrer
leitzinssaetze gesenkt. mit den zinssenkungen versucht die
chinesische notenbank, die schwaechelnde wirtschaft im land
anzukurbeln.  
++++

Note: The newsfeed reader and the device News run independently fom each other. To stop the printing of RSS feeds, it is sufficient to stop rssFileWriter.py e.g. with RSS-feed/rss-feed stop. Device News may remain enabled, piTelex' restart is not required.

Clone this wiki locally