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.
11
fork

Configure Feed

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.

jack 9170a34c 3ca09b2c

+14 -2
+13
src/index.ts
··· 1188 1188 if (potentialLinks.length > 0) { 1189 1189 const linkToEmbed = potentialLinks[potentialLinks.length - 1]; 1190 1190 if (linkToEmbed) { 1191 + // Optimization: If text is too long, but removing the link makes it fit, do it! 1192 + // The link will be present in the embed card anyway. 1193 + if (text.length > 300 && text.includes(linkToEmbed)) { 1194 + const lengthWithoutLink = text.length - linkToEmbed.length; 1195 + // Allow some buffer (e.g. whitespace cleanup might save 1-2 chars) 1196 + if (lengthWithoutLink <= 300) { 1197 + console.log(`[${twitterUsername}] 📏 Optimizing: Removing link ${linkToEmbed} from text to avoid threading (Card will embed it).`); 1198 + text = text.replace(linkToEmbed, '').trim(); 1199 + // Clean up potential double punctuation/spaces left behind 1200 + text = text.replace(/\s\.$/, '.').replace(/\s\s+/g, ' '); 1201 + } 1202 + } 1203 + 1191 1204 console.log(`[${twitterUsername}] 🃏 Fetching link card for: ${linkToEmbed}`); 1192 1205 linkCard = await fetchEmbedUrlCard(agent, linkToEmbed); 1193 1206 }
+1 -2
src/server.ts
··· 285 285 pendingBackfills.push({ id, limit: limit ? Number(limit) : undefined }); 286 286 } 287 287 288 - lastCheckTime = 0; 289 - nextCheckTime = Date.now() + 1000; 288 + // Do not force a global run; the scheduler loop will pick up the pending backfill in ~5s 290 289 res.json({ success: true, message: `Backfill queued for @${mapping.twitterUsernames.join(', ')}` }); 291 290 }); 292 291