Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Mastodon Social Link Detection #294

Open
zicklag opened this issue Jan 20, 2025 · 5 comments
Open

Support Mastodon Social Link Detection #294

zicklag opened this issue Jan 20, 2025 · 5 comments

Comments

@zicklag
Copy link
Collaborator

zicklag commented Jan 20, 2025

Right now we don't properly show a mastodon icon for social links to mastodon.

The issue is that you may have any number of different mastodon servers so we can't match on domain like we do for the other platforms.

We need to have the client try and fetch the /manifest.json or something else that will help us identify it as a mastodon server.

We could also allow the user to set a custom icon with an icon picker, which might be good.

@erlend-sh I'm curious what your thoughts are on custom icon / label for social links and it's UX. Custom Icons can have a nice UX maybe by making the icon preview clickable and open an icon picker:

Image

Custom labels would be annoying and I'm feeling like that should probably be relegated to the normal links section. Maybe that is argument enough to just put any links that don't have icons in your non-social links.

@erlend-sh
Copy link
Contributor

erlend-sh commented Jan 20, 2025

As suggested on chat, how about relying on favicons in this case?

As a temporary hack we could also just add the Mastodon icon for any profile with a /@username inside it, since that’s fairly unique to masto/fedi.

Custom icon picker would be nice but it’s a much bigger thing.

Solicited advice from fedi: https://writing.exchange/@erlend/113859654538675434

@edent
Copy link

edent commented Jan 20, 2025

DuckDuckGo has a free Favicon service. You pass it a domain name, it sends you the site's logo.

For example if soneone's social network is glammr.us, you can use https://icons.duckduckgo.com/ip9/glammr.us.ico

There are a few other services like this - some free, some paid. DDG seems most reliable to me. I use it for my blog.

@barredo
Copy link

barredo commented Jan 20, 2025

You could call the webfinger of that domain with an example account as resource. Here's more info https://docs.joinmastodon.org/spec/webfinger/

For instance, if the user says "my Mastodon profile is https://mastodon.social/@barredo" (my profile), you could call https://DOMAIN/.well-known/webfinger?resource=acct:USERNAME@DOMAIN (eg: https://mastodon.social/.well-known/webfinger?resource=acct:[email protected])

to get a json file with basic info regarding my profile. That doesn't tell you this is a Mastodon server, because other similar fediverse related software could use similar parameters, but it's a start.

You could also try to fetch the outbox of the user https://DOMAIN/users/USER/outbox?page=true (mine would be https://mastodon.social/users/Barredo/outbox?page=true and see if a mastodon json resource loads there. It should contain
toot: "http://joinmastodon.org/ns#" so you know it's a Mastodon server

@FenTiger
Copy link

Does nodeinfo help?

See eg here and here.

Not all Fediverse instances provide these endpoints.

@mediaformat
Copy link

Favicon is the most standard option, however if the instance has a custom favicon (retro.social) it will show that rather than the software which seems to be the intent. Nodeinfo will give you the software name, you could then use something like https://codeberg.org/WeDistribute/decentralized-social-icons

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants