Import Instagram archive to a Bluesky account
9
fork

Configure Feed

Select the types of activity you want to include in your feed.

Clean code

+4 -5
+4 -5
app.ts
··· 77 77 78 78 // If the post is made up of a single image, 79 79 // the text of the post appears to be associated with the only image present 80 - if ( post.media?.length == 1 ) { 81 - if( postText.length == 0) { 80 + if (post.media?.length == 1) { 81 + if (postText.length == 0) { 82 82 postText = post.media[0].title; 83 83 } 84 - if( postDate == undefined ) { 84 + if (postDate == undefined) { 85 85 postDate = new Date(post.media[0].creation_timestamp * 1000); 86 86 } 87 87 } ··· 132 132 const mediaFilename = `${process.env.ARCHIVE_FOLDER}/${postMedia.uri}`; 133 133 const imageBuffer = FS.readFileSync(mediaFilename); 134 134 135 - if( j>3 ) { 135 + if (j > 3) { 136 136 console.warn("Bluesky does not support more than 4 images per post, excess images will be discarded.") 137 137 break; 138 138 } 139 - 140 139 141 140 if (!SIMULATE) { 142 141 const blobRecord = await agent.uploadBlob(imageBuffer, {