All feed entries processed instead of only the first. Sorted by published timestamp (oldest first) to maintain correct chronological order in Discord. PEW colour rules still apply (Open/Planned → 0x51D3D4). State saved per incident so only updates/new incidents are posted

This commit is contained in:
Phil 2025-11-20 15:35:02 +00:00
parent 3f5cb1a1c5
commit 574cecb8c1

View File

@ -118,6 +118,14 @@ def parse_feed_entries(feed_xml):
"content": html.unescape(content_text)
})
# Sort entries by published timestamp (oldest first)
def parse_date(entry):
try:
return datetime.fromisoformat(entry["published"].replace("Z", "+00:00"))
except Exception:
return datetime.min # fallback if parsing fails
entries.sort(key=parse_date)
return entries
except ET.ParseError as e: