:: krowemoh

Thursday | 12 DEC 2024
Posts Links Other About Now

previous
next

Adding Mastodon to the Blog - 1

2023-03-10

I searched for a mastodon embedding tool and found a javascript app written by someone that does exactly what I want it to do. The source code is beautifully simple and so I'm going to rip out the queries and use it to write a mastodon embedding utility for myself.

The programmers dilemma! I want the utility to somehow already exist but as soon as I find the utility I have the urge to do it myself. What is this affliction.

https://gitlab.com/idotj/mastodon-embed-feed-timeline/-/blob/master/src/mastodon-timeline.js

This is the code I'm going to take inspiration from.

The following query will get you the user id from mastodon.social given a username:

curl https://mastodon.social/api/v1/accounts/lookup?acct={ACCT}

The following query will get the last 20 posts from the above user id:

curl https://mastodon.social/api/v1/accounts/{USERID}/statuses?limit=20