shireen

News and weather bot. Fetches current weather and forecasts from wttr.in, and streams headlines from configurable RSS feeds. Posts fresh headlines automatically at a per-channel interval and deduplicates across restarts.

Dependencies

No external libraries required (uses urllib and xml.etree.ElementTree).

Commands

CommandDescription
!weather <city>Current weather conditions
!forecast <city>Brief forecast (today + next 2 days)
`!headlines [global\mena\egypt] [n]`Fresh headlines, optionally filtered by label or count
!newsShow auto-broadcast state for this channel
!news onEnable auto-broadcast (owner/op)
!news offDisable auto-broadcast (owner/op)
!news interval <min>Set broadcast interval in minutes (owner/op)
!news count <n>Set headlines per broadcast cycle (owner/op)

Admin (owner)

CommandDescription
!join #channelJoin a channel
!part [#channel]Leave a channel
!chansList channels
!helpShow usage (PM)

Auto-broadcast

Every 90 minutes (default, per channel) shireen posts 1 headline (default) it hasn't posted before. GUIDs are persisted to the data JSON so the same article is never repeated across restarts. The cap is 1000 seen GUIDs (oldest pruned). Interval and count are configurable per channel with !news interval and !news count.

URL cleaning

All query strings and fragments are stripped from feed links before posting. News article URLs are fully identified by their path; query parameters from feeds are always tracking noise.

Default RSS feeds

IDNameLabel
bbc_worldBBC Worldglobal
reuters_worldReuters Worldglobal
ap_worldAP Newsglobal
guardian_worldThe Guardianglobal
arab_newsArab Newsmena
aljazeeraAl Jazeeramena
al_monitorAl-Monitormena
egypt_indepEgypt Independentegypt
daily_news_egyptDaily News Egyptegypt

Feeds can be modified directly in the data JSON (feeds array) while the bot is stopped. Each feed has: id, name, url, label, enabled.

Data file format

Created automatically at data_path on first run:

{
  "channels": {
    "#example": {
      "news_enabled": true,
      "broadcast_interval": 90,
      "broadcast_count": 1,
      "last_broadcast": 0
    }
  },
  "feeds": [...],
  "seen": ["guid1", "guid2"]
}

Config keys

KeyDefaultDescription
[shireen] data_path/var/shireen/data.jsonPath to state/config JSON (auto-created)
[shireen] broadcast_interval90Default minutes between auto-broadcast cycles
[shireen] broadcast_count1Default headlines posted per broadcast cycle
[shireen] headlines_count1Default headlines returned by !headlines