Select the types of activity you want to include in your feed.
A simple tool which lets you scrape twitter accounts and crosspost them to bluesky accounts! Comes with a CLI and a webapp for managing profiles! Works with images/videos/link embeds/threads.
Select the types of activity you want to include in your feed.
fix: prioritize backfills and optimize link handling for threads
- Prevent global schedule reset on backfill request to allow prioritization.\n- Automatically remove link from text if it avoids threading and can be embedded as a card.
···11881188 if (potentialLinks.length > 0) {
11891189 const linkToEmbed = potentialLinks[potentialLinks.length - 1];
11901190 if (linkToEmbed) {
11911191+ // Optimization: If text is too long, but removing the link makes it fit, do it!
11921192+ // The link will be present in the embed card anyway.
11931193+ if (text.length > 300 && text.includes(linkToEmbed)) {
11941194+ const lengthWithoutLink = text.length - linkToEmbed.length;
11951195+ // Allow some buffer (e.g. whitespace cleanup might save 1-2 chars)
11961196+ if (lengthWithoutLink <= 300) {
11971197+ console.log(`[${twitterUsername}] 📏 Optimizing: Removing link ${linkToEmbed} from text to avoid threading (Card will embed it).`);
11981198+ text = text.replace(linkToEmbed, '').trim();
11991199+ // Clean up potential double punctuation/spaces left behind
12001200+ text = text.replace(/\s\.$/, '.').replace(/\s\s+/g, ' ');
12011201+ }
12021202+ }
12031203+11911204 console.log(`[${twitterUsername}] 🃏 Fetching link card for: ${linkToEmbed}`);
11921205 linkCard = await fetchEmbedUrlCard(agent, linkToEmbed);
11931206 }
+1-2
src/server.ts
···285285 pendingBackfills.push({ id, limit: limit ? Number(limit) : undefined });
286286 }
287287288288- lastCheckTime = 0;
289289- nextCheckTime = Date.now() + 1000;
288288+ // Do not force a global run; the scheduler loop will pick up the pending backfill in ~5s
290289 res.json({ success: true, message: `Backfill queued for @${mapping.twitterUsernames.join(', ')}` });
291290});
292291