Allows you to use Mastodon and Bluesky comments on your Lustre blog hexdocs.pm/chilp/
blog gleam lustre indieweb mastodon bluesky comments
1
fork

Configure Feed

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

+7 -12
+7 -12
NOTES.md
··· 6 6 - [x] ~~GitHub issues, including a "[Comment via GitHub]" button.~~ For a later release, as this will require a lot of work to implement the GraphQL queries and mutations. 7 7 - [ ] Other platforms? Maybe? Depends on how much time I have, and how much demand there is for other platforms. 8 8 - [x] [fix] Adding `flex-wrap: wrap;` to `.widget .form-controls` to prevent the buttons from overflowing on smaller screens. 9 - - [ ] Remove the builtin CSS in favour of [DaisyUI](https://daisyui.com) classes. 9 + - [ ] Remove the builtin CSS in favour of [DaisyUI](https://daisyui.com) classes which means standardized class names for self-stylers, and site-themed widgets for everyone else! 10 10 11 11 ## [feat] Adding multiple back-ends 12 12 13 13 ### Fetching a post from Bluesky 14 14 This seems a little more complicated than fetching from Mastodon, but seems doable. 15 15 16 - From a uri, extract `handle` and `post_id` (e.g. `at://did:plc:abc123/app.bsky.feed.post/def456` -> `handle=abc123`, `post_id=def456`) 16 + Where for a mastodon post we need `instance` and `postid`, we now need `did` and `postid`. 17 17 18 - Then, fetch the post using the Bluesky API: 18 + Let's say they have been supplied as `did:plc:jgtfsmv25thfs4zmydtbccnn` (strawmelonjuice.com) and `3mgrbiiadws2k` 19 19 20 - Firstly, resolve the handle to get the DID: 21 - https://public.api.bsky.app/xrpc/com.atproto.identity.resolveHandle?handle=abc123 22 - 23 - This will return a DID (e.g. `did:plc:abc123`). 24 - 25 - Then, fetch a list of the user's posts: 26 - https://public.api.bsky.app/xrpc/app.bsky.feed.getAuthorFeed?actor=did:plc:abc123&filter=posts_with_replies&limit=100 20 + Fetch a list of the user's posts: 21 + https://public.api.bsky.app/xrpc/app.bsky.feed.getAuthorFeed?actor=did:plc:jgtfsmv25thfs4zmydtbccnn&filter=posts_with_replies&limit=100 27 22 28 23 This may require a few requests if the user has more than 100 posts, but we can paginate through them using the `cursor` parameter. 29 24 30 - Finally, find the post with the matching `post_id` (e.g. `def456`) in the list of posts and return it. 25 + Finally, find the post with the matching `post_id` in the list of posts and return it. 31 26 32 - Shaped like this: 27 + That'd be [this post](https://witchsky.app/profile/did:plc:jgtfsmv25thfs4zmydtbccnn/post/3mgrbiiadws2k), shaped like this (well this is embarrassing): 33 28 34 29 ```json 35 30 {