this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

three

alice 53302eff 4d300971

+59 -3
+40 -3
index.ts
··· 41 41 }); 42 42 } 43 43 44 - const two = true; 45 - 44 + const two = false; 46 45 if (two) { 47 46 const flirt = `could have saved myself some trouble by 48 47 ··· 52 51 53 52 autogenerated link, but no card yet: https://github.com/aliceisjustplaying/bluesky-experiments`; 54 53 const rt = new RichText({ text: flirt }); 55 - rt; 56 54 await rt.detectFacets(agent); // automatically detects mentions and links 57 55 await agent.post({ 58 56 $type: 'app.bsky.feed.post', ··· 71 69 }, 72 70 }); 73 71 } 72 + 73 + const three = true; 74 + if (three) { 75 + const feed = await agent.getAuthorFeed({ actor: process.env.BSKY_USERNAME!, limit: 10 }); 76 + const reply = feed.data.feed[0].post; // the latest post 77 + // console.log(reply); 78 + const root = (reply.record as any).reply.root; // the root post of the thread 79 + // console.log(root); 80 + const replyRoot = await agent.getPostThread({ uri: reply.uri }); // we don't *need* to do this but it's nice to have the full thread 81 + // console.log(replyRoot); 82 + // console.log((replyRoot.data.thread.parent as any).post); 83 + const newBlergh = 'autogenerated link, with a card: https://github.com/aliceisjustplaying/bluesky-experiments'; 84 + const rt = new RichText({ text: newBlergh }); 85 + await rt.detectFacets(agent); // automatically detects mentions and links 86 + await agent.post({ 87 + $type: 'app.bsky.feed.post', 88 + text: rt.text, 89 + facets: rt.facets, 90 + createdAt: new Date().toISOString(), 91 + reply: { 92 + root: { 93 + uri: root.uri, 94 + cid: root.cid, 95 + }, 96 + parent: { 97 + uri: reply.uri, 98 + cid: reply.cid, 99 + }, 100 + }, 101 + embed: { 102 + $type: 'app.bsky.embed.external', 103 + external: { 104 + uri: 'https://github.com/aliceisjustplaying/bluesky-experiments', 105 + title: "alice's bluesky experiments", 106 + description: "now i'm just playing around with the api some more", 107 + }, 108 + }, 109 + }); 110 + }
payload-example.json payload-examples/op.json
+19
payload-examples/reply2.json
··· 1 + { 2 + "collection": "app.bsky.feed.post", 3 + "repo": "did:plc:by3jhwdqgbtrcc7q4tkkv3cf", 4 + "record": { 5 + "text": "second reply", 6 + "reply": { 7 + "root": { 8 + "cid": "bafyreidt72dmp3dsq5qs5mocrauyj3ctwzyywxnjcd45rde2quae3zanjq", 9 + "uri": "at://did:plc:by3jhwdqgbtrcc7q4tkkv3cf/app.bsky.feed.post/3jszamd374c2h" 10 + }, 11 + "parent": { 12 + "uri": "at://did:plc:by3jhwdqgbtrcc7q4tkkv3cf/app.bsky.feed.post/3jszbjqpz4c2c", 13 + "cid": "bafyreib6pgc2i27e2xvyx4342onnkjyqzcjfst5kz7suy2wrnmuwvwubna" 14 + } 15 + }, 16 + "createdAt": "2023-04-10T11:56:26.339Z", 17 + "$type": "app.bsky.feed.post" 18 + } 19 + }
payload-reply-example.json payload-examples/reply.json