idk
This commit is contained in:
parent
862b11b9ef
commit
9c6da082a0
31 changed files with 441 additions and 263 deletions
|
|
@ -67,28 +67,7 @@ export async function getPosts(cursor?: string): Promise<Report[]> {
|
|||
".",
|
||||
),
|
||||
cid,
|
||||
} as Report)).filter((r) => r.visibility === "author").sort((a, b) =>
|
||||
b.date as any - (a.date as any)
|
||||
);
|
||||
} as Report)).sort((a, b) => b.date as any - (a.date as any));
|
||||
|
||||
return reports;
|
||||
}
|
||||
|
||||
export async function retrieveReport(rkey: string): Promise<Report | null> {
|
||||
const response = await xrpc("com.atproto.repo.getRecord", {
|
||||
collection: "com.whtwnd.blog.entry",
|
||||
repo: "acpi.at",
|
||||
rkey,
|
||||
});
|
||||
|
||||
if (!response) return null;
|
||||
|
||||
return {
|
||||
...response.value,
|
||||
readingTime: response.value.content
|
||||
? calculateReadingTime(response.value.content)
|
||||
: 1,
|
||||
cid: response.cid,
|
||||
rkey,
|
||||
} as Report;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ interface Track {
|
|||
url: string;
|
||||
}
|
||||
|
||||
export const FM_USER = "satisfeita";
|
||||
|
||||
const secret = Deno.env.get("FM_SECRET");
|
||||
export let tracks: (() => Track[]) | undefined;
|
||||
|
||||
|
|
@ -22,7 +24,7 @@ if (secret) {
|
|||
const client = new LastClient(secret);
|
||||
|
||||
tracks = await withInterval(async () => {
|
||||
const { tracks: raw } = await client.user.getRecentTracks("favewa", {
|
||||
const { tracks: raw } = await client.user.getRecentTracks(FM_USER, {
|
||||
limit: 5,
|
||||
extended: true,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue