Happy Friday!
Quick question for fediverse developers on how to link to a fediverse profile page on a remote server.
Post
Happy Friday!
Quick question for fediverse developers on how to link to a fediverse profile page on a remote server.
@evan Thank you, I'll read through this!
Say you are user@server.social and I want to link to the account ExternalUser@RemoteServer.social, but I want to open the profile from *your* server.
With Mastodon, I can do server.social/@ExternalUser@RemoteServer.social, if your server already knows about the remote account, I think? Either way, this is very Mastodon-centric, I believe.
I do know that I can get the "subscribe" URL (authorize_interaction for Mastodon and some other platforms) if I know your username.
So let's say I have an input field on a page that asks you just that.
I can then fetch:
https://server.social/.well-known/webfinger?resource=acct:user@server.social
Which I believe works across all fediverse platforms?
Activity Intents.
You want FEP-3b86 - Activity Intents: https://w3id.org/fep/3b86
It's gaining broad support from:
* Mastodon
* Wordpress
* Loops
* Friendica
* Emissary
* Forte
* Mitra
* PieFed
* (streams)
And there's two client libraries in the works. Mine is https://github.com/EmissarySocial/camperjs - it starts with intents, then falls back oStatus, then to known endpoints for older servers.
I'd love to work with you to see it solve this issue on your sites.
@benpate Yes, this is exactly what I need, and what I'm discussing here is just a workaround.
I did try looking into this before, is there maybe a working demo I could look at?
https://qwertylicious.dev/have-you-heard-of-qwertylicious
"Follow" should work for nearly all servers.
"Like" and "Comment" are less likely (but support is growing)
The new javascript library asks for your Fediverse username, then stores it locally on your device (nothing is sent to the server).
Then, it looks up what intents your server supports, fills in missing pieces based on known server addresses.
And, the JS disables any buttons that require intents that your server doesn't support.
@stefan I'll make one for you right now.
This shows me:
"aliases": [
"https://server.social/@user",
"https://server.social/users/user"
]
and
{
"rel": "http://ostatus.org/schema/1.0/subscribe",
"template": "https://server.social/authorize_interaction?uri={uri}"
}
So I know I should link to https://server.social/authorize_interaction?uri=https://RemoteServer.social/@ExternalUser
And I am fairly confident this will work. But I'd rather not ask people to put in their usernames, I'd hope I can figure this out from their server's domain?
Shouldn't the "subscribe" template be the same for all accounts on the same server/platform?
Maybe I could ask for the domain, determine the platform via nodeinfo, and then keep a list of URLs, eg if server.social runs on Mastodon, use the Mastodon "authorize_interaction" URL, for Friendica, it's "contact/follow", Misskey uses "authorize-follow", etc.
Is there such a list?
Or maybe there's a better approach altogether. Any pointers would be very appreciated!
A TLDR with an actual example:
If you visit https://bots.stefanbohacek.com, you can put in your server, and all the "Follow on Mastodon" links (might need to change the title) will open for you on your server, whether you use Mastodon, Lemmy, or Friendica.
I am manually creating a list of which endpoints each platform uses. There has to be a better way.
@stefan it should also have a profile page link. Or you can load the ActivityPub actor id (links, alternate, ld+json), and get the url property.