···11+import { QueryParams } from "@my/lexicon/server/types/app/bsky/feed/getFeedSkeleton";
22+import { AppContext } from "@/config";
33+44+// max 15 chars
55+export const shortname = "heb-ppl-pst-cmt";
66+77+export const handler = async (ctx: AppContext, params: QueryParams) => {
88+ let builder = ctx.db
99+ .selectFrom("post")
1010+ .selectAll()
1111+ .orderBy("indexedAt", "desc")
1212+ .orderBy("cid", "desc")
1313+ // .where("parent_cid", "is not", null) // this is what makes it only posts and not replies
1414+ .limit(params.limit);
1515+1616+ if (params.cursor) {
1717+ const timeStr = new Date(parseInt(params.cursor, 10)).toISOString();
1818+ builder = builder.where("post.indexedAt", "<", timeStr);
1919+ }
2020+ const res = await builder.execute();
2121+2222+ const feed = res.map((row) => ({
2323+ post: row.uri,
2424+ }));
2525+2626+ let cursor: string | undefined;
2727+ const last = res.at(-1);
2828+ if (last) {
2929+ cursor = new Date(last.indexedAt).getTime().toString(10);
3030+ }
3131+3232+ return {
3333+ cursor,
3434+ feed,
3535+ };
3636+};
+1
feed-generator/src/algos/heb-ppl-posts.ts
···1010 .selectAll()
1111 .orderBy("indexedAt", "desc")
1212 .orderBy("cid", "desc")
1313+ .where("parent_cid", "is not", null) // this is what makes it only posts and not replies
1314 .limit(params.limit);
14151516 if (params.cursor) {