chilp
Values
pub fn bluesky(
did did: String,
post_id postid: String,
) -> @internal Bluesky
Anchor to Bluesky
An anchor to the Bluesky post you want to fetch comments from.
| Parameter | Description |
|---|---|
did | Your DID, for @strawmelonjuice.com, this looks like "did:plc:jgtfsmv25thfs4zmydtbccnn".Not sure how to find your DID? https://bsky-did.neocities.org is one of the many places where you can easily find it. |
post_id | A post id to bind to, you’ll find this in a post url https://bsky.app/profile/<your-username-or-did>/post/[postid] |
pub fn mastodon(
instance instance: String,
post_id postid: String,
) -> @internal Mastodon
Anchor to Fediverse
An anchor to the Fediverse post you want to fetch comments from.
| Parameter | Description |
|---|---|
instance | The instance name, e.g. "mastodon.social", this is where your post is stored, and where chilp will attempt to fetch it from. |
post_id | A post id to bind to, you’ll find this in a post url https://instance.social/@<username>/[postid]. |
On Sharkey or Misskey this is a note id, found https://instance.social/notes/[note-id] |
pub fn register() -> Result(Nil, lustre.Error)
Widget activation
You should run this register function before using the widget component, so that Chilp can listen for it and load the component contents.
pub fn widget(
mastodon mastodon_anchor: option.Option(@internal Mastodon),
bluesky bsky_anchor: option.Option(@internal Bluesky),
) -> element.Element(msg)
The widget
Before adding this component make sure to call chilp.register() to register it!
Little example:
chilp.widget(
// We connect to Bluesky...
bluesky: option.Some(chilp.bluesky("did:plc:my-did","myPostId")),
// ...But not to Mastodon? Sure! Make it a None!
mastodon: option.None
)