diff --git a/src/jobs/twitter.ts b/src/jobs/twitter.ts index e180648..e178a13 100644 --- a/src/jobs/twitter.ts +++ b/src/jobs/twitter.ts @@ -8,20 +8,12 @@ export const job: Job = { name: 'Twitter', interval: 15 * 60, async run() { - const gimai_id = '1250594468262113280'; - const res: string[] | null = await fetch( - `https://api.twitter.com/2/users/${gimai_id}/tweets?max_results=5`, - { - headers: { - Authorization: `Bearer ${process.env.TWITTER_BEARER_TOKEN}`, - }, - }, + const res = await fetch( + 'https://rsshub.app/twitter/user/gimaiseikatsu.json?limit=5&sorted=true', ) - .then(async (v) => await v.json()) - .then((v) => (v as Record[]>).data) - .then((v) => - v.map((r: Record) => `https://twitter.com/gimaiseikatsu/status/${r.id}`), - ) + .then((v) => v.json()) + .then((v) => (v as Record).items as Record[]) + .then((v) => v.map((f) => f.url)) .catch(log); if (!res?.length) return;