my personal website!
1import { XRPC, CredentialManager } from "@atcute/client";
2
3const manager = new CredentialManager({
4 service: "https://inkcap.us-east.host.bsky.network",
5});
6const rpc = new XRPC({ handler: manager });
7
8let records = [];
9let cursor = undefined;
10do {
11 const response = (
12 await rpc.get("com.atproto.repo.listRecords", {
13 params: {
14 repo: "did:plc:avlpu4l2j5u3johint7tqrmu",
15 collection: "top.aylac.blog.entry",
16 cursor: cursor,
17 limit: 100,
18 },
19 })
20 ).data;
21 records = records.concat(response.records);
22 cursor = response.cursor;
23} while (cursor);
24records.sort(
25 (a, b) => new Date(b.value.createdAt) - new Date(a.value.createdAt),
26);
27
28export default function () {
29 return records;
30}