twitterbridge: one poller, per-webhook seen sets, fxtwitter links, outage DM
The RSSHub feed isn't strictly chronological, so 'post everything above the last guid' could skip tweets. Now a single poller fans out to both webhooks, each remembering posted guids (data/twitter_seen.json, atomic writes): new tweets anywhere above the oldest known one are posted oldest-first, old tweets sliding in after a deletion are ignored, failed posts retry next poll and Discord 429s are honoured. Links go out as fxtwitter.com for real embeds. The owner gets a DM after 90 min of broken feed and again on recovery. Night polling is now 1-2 h. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
234fbe88aa
commit
f8b3501637
3 files changed
+177
-151
No files matched your search
@@ -3,6 +3,8 @@ import aiohttp
|
||||
import feedparser
|
||||
from discord.ext import commands
|
||||
|
||||
from twitterbridge.rss import embed_link
|
||||
|
||||
REQUEST_TIMEOUT = 15
|
||||
|
||||
|
||||
@@ -50,10 +52,7 @@ class TwitterLeaks(commands.Cog):
|
||||
|
||||
response = "**Latest 5 Leaks:**\n"
|
||||
for entry in entries[:5]:
|
||||
link = entry.get('link', '')
|
||||
if 'nitter.net' in link:
|
||||
link = link.replace('nitter.net', 'twitter.com').replace('#m', '')
|
||||
response += f'\n{link}\n'
|
||||
response += f"\n{embed_link(entry.get('link', ''))}\n"
|
||||
|
||||
await ctx.reply(response[:2000])
|
||||
|
||||
|
||||
Reference in new issue
Block a user