Public
Back
Version 98
6/25/2023
type GetFeedSkeleton = {
feed: string;
limit?: number;
cursor?: string;
};
type SkeletonFeedPostReason = SkeletonReasonRepost;
// format: at-uri
type SkeletonReasonRepost = {
repost: string;
};
// };
type SkeletonFeedPost = {
post: string;
};
type GetFeedSkeletonOutput = {
feed: SkeletonFeedPost[];
cursor?: string;
};
async function friendOfAFriend(req: express.Request, res: express.Response) {
(await lukas.feedGenerator({
feed: {
id: "foaf",
displayName: "Friend of a Friend",
algorithm: async (
ctx,
skeleton: GetFeedSkeleton,
): Promise<GetFeedSkeletonOutput> => {
const requesterDid = await me.validateAuth(
req,
`did:web:lukas-friendofafriend.express.val.run`,
);
const feed = (await me.getFriendsOfFriends({
did: requesterDid,
limit: 20,
})).map(({ uri }) => ({ post: uri }));
return {
Updated: October 23, 2023