Thursday | 21 NOV 2024
[ previous ]
[ next ]

Adding Mastodon to the Blog - 1

Title:
Date: 2023-03-10
Tags:  

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