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: versatile screenshots, decode HTML entities, and improve faceting

jack c2c1ac14 2be241c1

+25 -4
+25 -4
src/index.ts
··· 264 264 } 265 265 266 266 async function captureTweetScreenshot(tweetUrl: string): Promise<Buffer | null> { 267 - console.log(`[SCREENSHOT] 📸 Capturing screenshot for: ${tweetUrl}`); 267 + const browserPaths = [ 268 + '/usr/bin/google-chrome', 269 + '/usr/bin/chromium-browser', 270 + '/usr/bin/chromium', 271 + '/usr/bin/google-chrome-stable', 272 + 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe', 273 + 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe', 274 + ]; 275 + 276 + const executablePath = browserPaths.find(p => fs.existsSync(p)); 277 + 278 + if (!executablePath) { 279 + console.warn(`[SCREENSHOT] ⏩ Skipping screenshot (no Chrome/Chromium found at common paths).`); 280 + return null; 281 + } 282 + 283 + console.log(`[SCREENSHOT] 📸 Capturing screenshot for: ${tweetUrl} using ${executablePath}`); 268 284 let browser; 269 285 try { 270 286 browser = await puppeteer.launch({ 271 - executablePath: '/usr/bin/google-chrome', 272 - args: ['--no-sandbox', '--disable-setuid-sandbox'], 287 + executablePath, 288 + args: ['--no-sandbox', '--disable-setuid-sandbox', '--disable-dev-shm-usage'], 273 289 }); 274 290 const page = await browser.newPage(); 275 291 await page.setViewport({ width: 800, height: 1200, deviceScaleFactor: 2 }); ··· 558 574 continue; 559 575 } 560 576 561 - let text = tweetText; 577 + let text = tweetText 578 + .replace(/&amp;/g, '&') 579 + .replace(/&lt;/g, '<') 580 + .replace(/&gt;/g, '>') 581 + .replace(/&quot;/g, '"') 582 + .replace(/&#39;/g, "'"); 562 583 563 584 // 1. Link Expansion 564 585 console.log(`[${twitterUsername}] 🔗 Expanding links...`);