I’ve started work on my #Mastodon client library, #MastoBot.
Initial work has progressed well; I have wrappers for HTML methods and reasonable coverage of helpers for Mastodon API endpoints.
I’ve published the WIP at https://gitlab.com/eroosenmaallen/mastobot
I’m aiming to offer three levels of API:
- HTTP wrappers, so
get
,post
,delete
, etc., with reasonable defaults and helpers to make raw http requests comfortably - API endpoint wrappers, so eg.
getNotifications()
as a wrapper to.get('v1/notifications')
. - Feed handlers. This is where the cool happens:
.processNotifications({ onMention, onFavourite })
, then the callbacks will be called for objects coming back from the API. I think this will offer a really slick API for building bots
Next step should be more complete coverage of API endpoints, but I think I’m going to start on the smart API, then backfill endpoints as I go.
Very shortly I should be able to switch my multiverse bot over to this library, I’m excited to get actually using it.
Feedback is welcome, here or at Gitlab or via Mastodon. Especially if you’re interested in building a client or not, I’d love to hear your wish list and ideas.