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
feat: add 'Reset & Backfill' button to clear cache and re-sync
jack
2 months ago
225b5f0a
90b70a02
+26
-3
1 changed file
expand all
collapse all
unified
split
public
index.html
+26
-3
public/index.html
···
233
}
234
};
235
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
236
const updateTwitter = async (e) => {
237
e.preventDefault();
238
const formData = new FormData(e.target);
···
387
<td className="text-end">
388
{isAdmin && (
389
<>
390
-
<button onClick={() => runBackfill(m.id, m.twitterUsername)} className="btn btn-link btn-sm text-warning p-0 me-2" title="Backfill">
391
<span className="material-icons">history</span>
392
</button>
393
-
<button onClick={() => clearCache(m.id, m.twitterUsername)} className="btn btn-link btn-sm text-secondary p-0 me-2" title="Clear Cache">
0
0
0
394
<span className="material-icons">delete_sweep</span>
395
</button>
396
</>
397
)}
398
-
<button onClick={() => deleteMapping(m.id)} className="btn btn-link btn-sm text-danger p-0" title="Delete">
399
<span className="material-icons">delete</span>
400
</button>
401
</td>
···
233
}
234
};
235
236
+
const resetAndBackfill = async (id, twitterUsername) => {
237
+
const limit = prompt(`Reset cache and backfill how many tweets for @${twitterUsername}?`, "100");
238
+
if (limit === null) return;
239
+
240
+
try {
241
+
// 1. Clear Cache
242
+
await axios.delete(`/api/mappings/${id}/cache`, {
243
+
headers: { Authorization: `Bearer ${token}` }
244
+
});
245
+
// 2. Queue Backfill
246
+
await axios.post(`/api/backfill/${id}`, { limit: parseInt(limit) || 100 }, {
247
+
headers: { Authorization: `Bearer ${token}` }
248
+
});
249
+
alert(`Cache cleared and backfill queued for @${twitterUsername}`);
250
+
setTimeout(fetchStatus, 1000);
251
+
} catch (err) {
252
+
alert('Reset & Backfill failed');
253
+
}
254
+
};
255
+
256
const updateTwitter = async (e) => {
257
e.preventDefault();
258
const formData = new FormData(e.target);
···
407
<td className="text-end">
408
{isAdmin && (
409
<>
410
+
<button onClick={() => runBackfill(m.id, m.twitterUsername)} className="btn btn-link btn-sm text-warning p-0 me-2" title="Backfill (Keep Cache)">
411
<span className="material-icons">history</span>
412
</button>
413
+
<button onClick={() => resetAndBackfill(m.id, m.twitterUsername)} className="btn btn-link btn-sm text-danger p-0 me-2" title="Reset & Backfill (Clears Cache)">
414
+
<span className="material-icons">restart_alt</span>
415
+
</button>
416
+
<button onClick={() => clearCache(m.id, m.twitterUsername)} className="btn btn-link btn-sm text-secondary p-0 me-2" title="Clear Cache Only">
417
<span className="material-icons">delete_sweep</span>
418
</button>
419
</>
420
)}
421
+
<button onClick={() => deleteMapping(m.id)} className="btn btn-link btn-sm text-danger p-0" title="Delete Account">
422
<span className="material-icons">delete</span>
423
</button>
424
</td>