newsnow/scripts/refresh.ts
2024-10-21 23:09:26 +08:00

11 lines
292 B
TypeScript

import process from "node:process"
import { sources } from "../shared/sources"
Promise.all(Object.keys(sources).map(id =>
fetch(`https://newsnow.busiyi.world/api/s/${id}?latest`, {
headers: {
Authorization: `Bearer ${process.env.JWT_TOKEN}`,
},
}),
)).catch(console.error)