fetch and archive my social posts
11 console.log("⏰ Cron at", new Date(interval.lastRunAt).toISOString());
12
13 // 1) Fetch & cache raw dump
14 const raw = await fetch(RAW_URL).then(r => r.json());
15 const rawJson = JSON.stringify(raw);
16 const prev = await sqlite.execute({
29 .slice(0, 50);
30
31 // 3) Fetch full details for those 50
32 const details = await Promise.all(
33 candidates.map(m => fetch(DETAIL_URL(m.id)).then(r => r.json())),
34 );
35 const detailsMap = new Map(details.map(m => [m.id, m]));
95
96 try {
97 const verifyResult = await fetch(verifyUrl, {
98 method: "POST",
99 body: verifyData,