My Fedi-Follow widget is ready for a full 1.0.0 release!
The widget provides an interface for Fediverse users to easily follow or share a url from their home instance. It’s the first stage in my plan to make it easier to integrate Fediverse sharing and following into other platforms, like WordPress or other site engines.
This 1.0.0 release has full support for following and sharing on Mastodon, and it has a fallback mode for unsupported platforms where it copies the account/toot to the visitor’s clipboard.
To use the Follow feature, link your visitor to the widget with your account in the `url` parameter: https://eroosenmaallen.gitlab.io/fedi-follow/?follow=https://roosenmaallen.com/author/admin
To share a url (or any text, really), url encode it into the `share` parameter: https://eroosenmaallen.gitlab.io/fedi-follow/?share=https://roosenmaallen.com/2022/06/22/full-1-0-0-release-fedi-follow-widget/
It has initial support for some light styling; see the documentation for details there. That part is pretty beta still, but could be fun. I’m open to ideas for a better representation in the qs.
Like I mentioned, this standalone widget is only the first stage. For part 2, I already have a minimal implementation of the follow and share features; the plan is to provide an optional on-page widget, wrappers to eg. automatically update widget links on the page to smarter buttons (but maintain the fallback to use the standalone widget), and later produce WordPress plugins to integrate the share button (and the copy-to-clipboard feature, because I just think it’s neat) into the ubiquitous Share This clusters.
I have some decent example code for a WordPress plugin to create a new Sharing button integrated into the Jetpack Social button group, which is what I use here — are there other common Sharing plugins I should look at supporting?
The other open question is platform detection and support. Right now, I probe for Mastodon’s `/api/v1/instance` endpoint; if I get a reasonable-looking object back then I declare the instance to be Masto and unlock the full feature set, otherwise I continue down the (currently empty) list and try to detect each platform type on the instance.
I know about Misskey, Pleroma, PixelFed, some others… what I need now is:
- A list of Fedi instance types, and for each:
- How to identify it (from JavaScript in a browser, with CORS and all the fun that means)
- If/how to Share from outside the instance
- If/how to Follow from outside
Initial reading suggests Misskey at least supports this (yay!), and that there is no ActivityPub standard around discovery of these endpoints (boo!).