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.

fix(threading): increment timestamps for split chunks to fix feed ordering

feat(logging): add verbose logging for tweet fetching and processing failures

jack 5db3d46f d78f8fda

+16 -2
+16 -2
src/index.ts
··· 823 823 return []; 824 824 } 825 825 } 826 + 827 + console.log(`[${username}] ⚠️ Scraper returned 0 tweets (or failed silently) after retries.`); 826 828 return []; 827 829 } 828 830 ··· 1151 1153 await rt.detectFacets(agent); 1152 1154 const detectedLangs = detectLanguage(chunk); 1153 1155 1156 + // Add offset for split chunks to ensure correct ordering/threading 1157 + let postDate = tweet.created_at ? new Date(tweet.created_at) : new Date(); 1158 + if (i > 0) { 1159 + postDate = new Date(postDate.getTime() + i * 1000); 1160 + } 1161 + 1154 1162 // biome-ignore lint/suspicious/noExplicitAny: dynamic record construction 1155 1163 const postRecord: Record<string, any> = { 1156 1164 text: rt.text, 1157 1165 facets: rt.facets, 1158 1166 langs: detectedLangs, 1159 - createdAt: tweet.created_at ? new Date(tweet.created_at).toISOString() : new Date().toISOString(), 1167 + createdAt: postDate.toISOString(), 1160 1168 }; 1161 1169 1162 1170 if (i === 0) { ··· 1377 1385 1378 1386 for (const twitterUsername of mapping.twitterUsernames) { 1379 1387 try { 1388 + console.log(`[${twitterUsername}] 🏁 Starting check for new tweets...`); 1380 1389 updateAppStatus({ state: 'checking', currentAccount: twitterUsername, message: 'Fetching latest tweets...' }); 1381 1390 1382 1391 // Use fetchUserTweets with early stopping optimization 1383 1392 // Increase limit slightly since we have early stopping now 1384 1393 const tweets = await fetchUserTweets(twitterUsername, 50, processedIds); 1385 1394 1386 - if (!tweets || tweets.length === 0) continue; 1395 + if (!tweets || tweets.length === 0) { 1396 + console.log(`[${twitterUsername}] ℹ️ No tweets found (or fetch failed).`); 1397 + continue; 1398 + } 1399 + 1400 + console.log(`[${twitterUsername}] 📥 Fetched ${tweets.length} tweets.`); 1387 1401 await processTweets(agent, twitterUsername, mapping.bskyIdentifier, tweets, dryRun); 1388 1402 } catch (err) { 1389 1403 console.error(`❌ Error checking ${twitterUsername}:`, err);