Teletekst Bot
By Erwin
- 2 minutes read - 326 wordsStatus
Active since July 2024
What
Monitor the news ("Nieuws" in Dutch) such as it is shared by the NOS Teletekst, by checking the references from the index pages at 101, 102, and 103, and then scan for any other pages from 104 to 199.
When a new page is found, or an existing page is updated (using a relatively basic heuristic), post the new or updated page to the Mastodon account. It also attempts to detect when a page is moved around.
Because occasionally pages are included for sport (in general) or soccer (voetbal), it will use an appropriate #TeletekstXYZ hashtag for that, so people can mute that. The same goes for the content updates, which can be a bit much especially for emerging stories, and get tagged with #TeletekstUpdate.
For content updates the posts also includes comparison of the previous and current version with color-coding for words or lines that have been removed, were added, or stayed the same. It's similar to git diff but has been adapted to make more sense in this text context.
If the content was unchanged and only the page number or title changed, the existing Mastodon post is updated in place.
Where
https://mstdn.social/@teletekst (originally at https://botsin.space/@teletekst, but that server shut down at the end of 2024).
How
There are two Cron jobs:
- Every 5 minutes a program walks all the pages from 101 to 199, using the
next pagereferences. If all pages are exactly identical, discard the results. It needs to gracefully handle brokennext pagelinks and other quirks. - Also every 5 minutes, but a minute later, a second program checks if changes were found. If so, look for new pages, deletes pages, moved pages, and modified pages. Two pages are treated differently, namely the "Kort nieuws binnenland" and "Kort nieuws buitenland", where one or two short national or international news items are dumped.
Disclaimer
This is not an (official or endorsed) NOS.nl service!
You can leave a comment by replying to this post with your own Mastodon/Fediverse account.