[READ-ONLY] Mirror of https://github.com/flo-bit/skywatched. review movies and tv shows, based on at proto
skywatched.app
679 B
26 lines
1import fs from 'fs';
2
3async function main() {
4 // const backendUrl = 'http://127.0.0.1:3001';
5 const backendUrl = 'https://skywatched-jetstream.fly.dev';
6
7 // get all authors from "author-dids.json"
8 const authorDids = JSON.parse(fs.readFileSync('author-dids.json', 'utf8'));
9
10 console.log(authorDids);
11
12 for (const authorDid of authorDids) {
13 try {
14 const response = await fetch(`${backendUrl}/api/refresh-user?did=${authorDid}`);
15 const data = await response.json();
16 console.log(data);
17 } catch (error) {
18 console.error(`Error refreshing user ${authorDid}:`, error);
19 }
20
21 // wait 1 second
22 await new Promise((resolve) => setTimeout(resolve, 1000));
23 }
24}
25
26main();