mport all tweets exported from X/Twitter to a Bluesky account.

source maps

Changed files
+24 -15
+1
.gitignore
··· 18 18 19 19 # mapping files 20 20 tweets_mapping.json 21 + **/*.js.map
+21 -14
app.ts
··· 733 733 //I wait 3 seconds so as not to exceed the api rate limits 734 734 await new Promise(resolve => setTimeout(resolve, API_DELAY)); 735 735 736 - const recordData = await rateLimitedAgent.post(postRecord); 737 - const i = recordData.uri.lastIndexOf("/"); 738 - if (i > 0) { 739 - const postUri = getBskyPostUrl(recordData.uri); 740 - console.log("Bluesky post create, URL: " + postUri); 736 + try 737 + { 738 + const recordData = await rateLimitedAgent.post(postRecord); 739 + const i = recordData.uri.lastIndexOf("/"); 740 + if (i > 0) { 741 + const postUri = getBskyPostUrl(recordData.uri); 742 + console.log("Bluesky post create, URL: " + postUri); 741 743 742 - importedTweet++; 743 - } else { 744 - console.warn(recordData); 744 + importedTweet++; 745 + } else { 746 + console.warn(recordData); 747 + } 748 + 749 + // store bsky data into sortedTweets (then write into the mapping file) 750 + currentData.bsky = { 751 + uri: recordData.uri, 752 + cid: recordData.cid, 753 + }; 754 + } 755 + catch (error: any) { 756 + console.warn(`Error posting tweet: ${postRecord} ${error.message}`); 745 757 } 746 - 747 - // store bsky data into sortedTweets (then write into the mapping file) 748 - currentData.bsky = { 749 - uri: recordData.uri, 750 - cid: recordData.cid, 751 - }; 758 + 752 759 } else { 753 760 importedTweet++; 754 761 }
+2 -1
tsconfig.json
··· 8 8 "forceConsistentCasingInFileNames": true, 9 9 "strict": true, 10 10 "noImplicitAny": false, 11 - "skipLibCheck": true 11 + "skipLibCheck": true, 12 + "sourceMap": true, 12 13 }, 13 14 "ts-node": { 14 15 "esm": true