RSS and quote improvements on the 3.6dev development line — MB809 to MB813.
The Daily Prophet has its place in the common room. It does not need to arrive every time someone turns a page.
This round of Mediabot work fixes two rather different problems: news that needed a more restrained delivery schedule, and quotes that had become suspiciously quiet. RSS feeds now have channel-wide pacing controls and a convenient latest-article preview. Quote search answers again, and +RandomQuote has a working periodic scheduler with a frequency you can set for each channel.
The spellbook is still IRC-shaped: ordinary commands, explicit channel settings, and room for people to talk between announcements.
A feed’s polling interval answers one question: how often should Mediabot check for new articles? It does not answer how often a channel should receive news.
Those two clocks can now be controlled separately. From a console channel, an authorized operator can configure a registered destination like this:
!rss #news limit gap=180 daily=3
!rss #news add LeMonde https://www.lemonde.fr/rss/une.xml interval=30 max=1
Here, Mediabot checks the feed every 30 minutes, while automatic RSS announcements on the whole #news channel share a minimum three-hour gap and a maximum of three attempts in any rolling 24-hour window.
The limits apply across feeds. Adding another subscription does not give it a separate allowance. The daily window does not reset at midnight, and the ceiling is not a promise to publish three articles every day: there must be new content and an eligible later poll.
The first successful poll remains silent, establishing a baseline rather than emptying an old newspaper onto the channel. With pacing enabled, Mediabot keeps one recent candidate per feed and suppresses superseded entries. Restarting the bot or reaching the next available slot does not unleash a backlog.
An attempted send reserves its slot even if channel policy rejects the output. Paced news fits into one IRC line and does not enter the deferred AntiFlood queue. The history survives restarts and normal updates; changing the limits does not erase it.
If the feed already exists, simply set the channel limits. There is no need to delete and recreate the subscription.
Feed management now accepts the destination first, making console use straightforward:
!rss #news list
!rss #news info LeMonde
!rss #news limit
!rss #news latest LeMonde
list shows the channel’s subscriptions. info inspects a feed, and limit reports the pacing policy and remaining wait privately.
The new latest command fetches the feed and previews one recent article, with its title and link. It prefers the newest usable publication date among the inspected entries, retaining feed order when dates cannot decide the result.
The preview answers where you requested it. Calling !rss #news latest LeMonde from the console does not publish a test article on #news. If the issuing channel itself has RSS pacing enabled, the preview is sent privately. A disabled feed can be previewed without enabling it.
This inspection does not consume an automatic news slot, acknowledge an article, or change polling history. It has its own 15-second cooldown.
There is also a small but welcome WeeChat correction: private latest, show and probe replies now use ordinary NOTICE text, without a CTCP ACTION wrapper. Public news retains its existing ACTION presentation.
Subscription and limit changes require authentication plus channel level 400 or higher on the destination, or global Administrator privileges. Console access alone does not grant rights over another channel.
These familiar commands should once again produce a useful answer:
!q s normal
!q search normal
The broken search path was finding matching rows, then failing while ranking them before it could send a reply. That ranking has been repaired.
Search keeps its channel scope and literal text matching. Matches are ordered by the number of occurrences, then by the newest quote id. The response includes a bounded summary and the best match; an empty search receives an explicit “no quote found” answer.
Quotes without an attributed author are included. Searching does not modify the saved quotes or their recall counters, and the regression checks exercise both the built-in command and the quotes-v3 read path.
One useful distinction: q search searches quote text in the current channel. Typing a nickname there only matches quotes containing that nickname in their text; it is not an author lookup.
+RandomQuote was meant to share a quote periodically. Its old scheduling block sat outside the timer, so it could not perform that regular work. It also counted anonymous quotes while selecting through an author join that could exclude them.
Automatic quotes now run through the periodic scheduler and include anonymous entries. Activation and frequency remain separate controls:
!chanset #news +RandomQuote
!randomquote #news every 60m
!randomquote #news
The last command privately reports activation, frequency, quote count and the next attempt. From the destination channel itself, !randomquote every 60m is sufficient.
Intervals accept minutes, hours or days, between 15 minutes and seven days. every 2h and every 1d work; a bare number means minutes. Without an override, the bot uses a valid main.RANDOM_QUOTE value in seconds, or defaults to three hours.
!randomquote #news default
!chanset #news -RandomQuote
default removes the channel override. The chanset remains the switch for pausing or enabling announcements; setting a frequency does not enable it. These controls require authentication and Administrator privileges, or channel level 450 on the target.
A newly observed enabled, joined channel waits a full interval. Changing its frequency starts a new interval. Schedules survive restarts, and an overdue schedule can produce one attempt before continuing from the current time. Missed slots are never replayed in a burst.
Selection runs in bounded workers. Before sending, Mediabot checks that it is still connected and joined, that +RandomQuote is still enabled, and that the schedule has not changed. A late result after a PART, reconnect or reconfiguration is discarded.
Each attempt produces at most one normal PRIVMSG, with safe UTF-8 truncation and the existing channel filters. Empty channels and failed attempts wait for the next interval. With several quotes available, the last accepted id is excluded from the next selection; a channel with one quote can naturally repeat it.
RSS and RandomQuote have independent schedules, so choose both frequencies with the channel’s overall activity in mind.
These changes belong to 3.6dev. The new RandomQuote cases pass 126 focused assertions covering persistence, authorization, SQL selection, worker execution, output bounds and stale replies. Quote search, command registration, help and RSS behavior are also covered by targeted integration checks.
The normal workflow remains: validate on dev, run the full test suite before committing, then promote through the usual update process. Development and production keep their own feeds, quotes and pacing settings. Promoting source code does not copy the dev configuration into production.
Examples above use !. On a bot configured with m, use m rss #news latest LeMonde or m randomquote #news every 60m. Replace #news with your registered channel.
The owls have a timetable again. The quote shelves are open. There should still be plenty of space in the common room for the conversation that made those quotes worth saving.
You must be logged in to reply.