taevas.xyz/api/infos/coding/kitsudev.ts
Taevas 9818adb12d
Use custom headers to possibly bypass Anubis & co
As recommended by the kind Kio!
(so now most requests use a custom user-agent)
2025-04-17 13:38:00 +02:00

23 lines
688 B
TypeScript

import { type KitsudevInfo } from "#Infos/Coding/KitsuDev.tsx";
import { headers, parseJson, type Handler } from "../..";
const username = "Taevas";
export const kitsudev: Handler = async () => {
/** https://kitsunes.dev/api/swagger#/user/userListActivityFeeds */
const kitsudev = await parseJson(await fetch(`https://kitsunes.dev/api/v1/users/${username}/activities/feeds?limit=1`, {headers})) as [{
repo: {
full_name: string
html_url: string
}
created: string
}];
const info: KitsudevInfo = {
name: kitsudev[0].repo.full_name,
url: kitsudev[0].repo.html_url,
date: kitsudev[0].created
};
return Response.json(info, {status: 200});
};