From 1d890055bd995823907b8fa4930267544aa2a568 Mon Sep 17 00:00:00 2001 From: dholms Date: Thu, 21 Sep 2023 21:53:31 -0500 Subject: [PATCH] re-enable getPopular --- .../pds/src/app-view/api/app/bsky/unspecced.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/pds/src/app-view/api/app/bsky/unspecced.ts b/packages/pds/src/app-view/api/app/bsky/unspecced.ts index 222b58ffde5..482adb3dbd8 100644 --- a/packages/pds/src/app-view/api/app/bsky/unspecced.ts +++ b/packages/pds/src/app-view/api/app/bsky/unspecced.ts @@ -7,7 +7,20 @@ import AppContext from '../../../../context' export default function (server: Server, ctx: AppContext) { server.app.bsky.unspecced.getPopular({ auth: ctx.accessVerifier, - handler: async () => { + handler: async ({ auth, params }) => { + const requester = auth.credentials.did + const HOT_CLASSIC_URI = + 'at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.generator/hot-classic' + const HOT_CLASSIC_DID = 'did:plc:5fllqkujj6kqp5izd5jg7gox' + const res = await ctx.appviewAgent.api.app.bsky.feed.getFeed( + { feed: HOT_CLASSIC_URI, limit: params.limit, cursor: params.cursor }, + await ctx.serviceAuthHeaders(requester, HOT_CLASSIC_DID), + ) + return { + encoding: 'application/json', + body: res.data, + } + return { encoding: 'application/json', body: { feed: [] },