tangled
alpha
login
or
join now
indexx.dev
/
tweets2bsky
forked from
j4ck.xyz/tweets2bsky
0
fork
atom
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.
0
fork
atom
overview
issues
pulls
pipelines
fix: robust error handling for multi-account processing loops
jack
2 months ago
677ab6a8
539dd1d6
+14
-6
1 changed file
expand all
collapse all
unified
split
src
index.ts
+14
-6
src/index.ts
···
1026
1026
console.log(`[${mapping.bskyIdentifier}] Running backfill for ${mapping.twitterUsernames.length} accounts (limit ${limit})...`);
1027
1027
1028
1028
for (const twitterUsername of mapping.twitterUsernames) {
1029
1029
-
updateAppStatus({ state: 'backfilling', currentAccount: twitterUsername, message: `Starting backfill (limit ${limit})...` });
1030
1030
-
await importHistory(twitterUsername, mapping.bskyIdentifier, limit, dryRun);
1029
1029
+
try {
1030
1030
+
updateAppStatus({ state: 'backfilling', currentAccount: twitterUsername, message: `Starting backfill (limit ${limit})...` });
1031
1031
+
await importHistory(twitterUsername, mapping.bskyIdentifier, limit, dryRun);
1032
1032
+
} catch (err) {
1033
1033
+
console.error(`❌ Error backfilling ${twitterUsername}:`, err);
1034
1034
+
}
1031
1035
}
1032
1036
clearBackfill(mapping.id);
1033
1037
console.log(`[${mapping.bskyIdentifier}] Backfill complete.`);
1034
1038
} else {
1035
1039
for (const twitterUsername of mapping.twitterUsernames) {
1036
1036
-
updateAppStatus({ state: 'checking', currentAccount: twitterUsername, message: 'Fetching latest tweets...' });
1037
1037
-
const result = await safeSearch(`from:${twitterUsername}`, 30);
1038
1038
-
if (!result.success || !result.tweets) continue;
1039
1039
-
await processTweets(agent, twitterUsername, mapping.bskyIdentifier, result.tweets, dryRun);
1040
1040
+
try {
1041
1041
+
updateAppStatus({ state: 'checking', currentAccount: twitterUsername, message: 'Fetching latest tweets...' });
1042
1042
+
const result = await safeSearch(`from:${twitterUsername}`, 30);
1043
1043
+
if (!result.success || !result.tweets) continue;
1044
1044
+
await processTweets(agent, twitterUsername, mapping.bskyIdentifier, result.tweets, dryRun);
1045
1045
+
} catch (err) {
1046
1046
+
console.error(`❌ Error checking ${twitterUsername}:`, err);
1047
1047
+
}
1040
1048
}
1041
1049
}
1042
1050
} catch (err) {