Mastodon: Expose instance metadata as json-ld

Created on 11 Mar 2018  路  13Comments  路  Source: tootsuite/mastodon

In the context of https://github.com/TheKinrar/mastodon-instances and https://github.com/libresh/catalog it would be a great feature to be able to scrape information in an automated manner.

As an admin, I already fill these metadata (description, name...) in the admin interface.

Exposing them as json-ld would ease the automation around listing instances and hosters that offer mastodon.

suggestion

Most helpful comment

Any update on this? I'm writing a program that aims to work with as many different fediverse instances as possible, and I'd really like it if there was a standard supported by all of them. nodeinfo is used by Pleroma, Misskey, Friendica, Osada, Hubzilla, GangGo, Diaspora*, and probably others. The only instance types I've been able to find that don't work with it are GNU Social (which was last updated in late 2014) and Mastodon.

All 13 comments

There is no standard for "instance data" in ActivityPub, but we already have a REST API that does this: /api/v1/instance - mastodon-instances uses that + some extra info they have admins fill-in manually.

To be precise there is an emerging protocol for this kinda thing, but it's not JSON-LD afaik: https://github.com/jaywink/nodeinfo2

@Gargron is it a typo? Did you want to point to https://github.com/jhass/nodeinfo instead?

Created this issue also to know about json-ld: https://github.com/jhass/nodeinfo/issues/19

It would be good to have nodeinfo, nodeinfo2 or something else standarized as being listed at https://mastodon.social/api/v1/instance/peers (or some other popular instance) automatically subscribes the domain to a bunch of crawlers trying several different URLs, some of them every 5 minutes!

https://github.com/jhass/nodeinfo would be the one to use, Pleroma is implementing it, and other servers like Funkwhale too.

{
  "version": "2.0",
  "software": {
    "name": "diaspora",
    "version": "0.5.0"
  },
  "protocols": ["diaspora"],
  "services": {
    "inbound": ["gnusocial"],
    "outbound": ["facebook", "twitter"]
  },
  "openRegistrations": true,
  "usage": {
    "users": {
      "total": 123,
      "activeHalfyear": 42,
      "activeMonth": 23
    },
    "localPosts": 500,
    "localComments": 1000
  },
  "metadata": {
    "chat_enabled": true
  }
}

From the example.json of 2.0 schema. Mind most properties are camelCase, but chat_enabled is snake_case, and activeHalfyear is neither (halfyear is not a word), plus the fact that those timeframes are super arbitrary.

It seems to still be in an early stage and I'm not in a hurry to adopt it (it also doesn't have an official body like a W3C working group behind it)

activeHalfyear etc. are not mandatory at all. users->total is the minimum, localPosts may be, the other one no.

and about "chat_enabled" it's the metadata field, which is free-form, you can use "chatEnabled" if you want.

(it also doesn't have an official body like a W3C working group behind it)

To be fair, we just adopted RSS, which is a non-standard and deprecated technology, even as Atom have been standardized by an official body, the IETF, more than ten years ago. So I'm not really sure it's a concern here.

It seems there are two problems (well, three if you count RSS ;) ): one is the location of statistics endpoints (currently hardcoded in crawlers as /api/v1/instance... etc.) and the statistics format. The latter will take some time to stabilize as there are multiple parties involved.

But the location of statistics endpoints - what various nodeinfo specs define as /.well-known/nodeinfo or x-nodeinfo-2 etc. could be stored in a place that is already defined: /.well-known/host-meta.

So Mastodon could add host-meta link with rel (e.g.) https://joinmastodon/ns#instance-info, pointing to /api/v1/instance, nodeinfo could use their own rel http://nodeinfo.diaspora.software/ns/schema/2.0 and crawlers could use one endpoint, that is standarized right now to quickly see what stats are available.

Any update on this? I'm writing a program that aims to work with as many different fediverse instances as possible, and I'd really like it if there was a standard supported by all of them. nodeinfo is used by Pleroma, Misskey, Friendica, Osada, Hubzilla, GangGo, Diaspora*, and probably others. The only instance types I've been able to find that don't work with it are GNU Social (which was last updated in late 2014) and Mastodon.

Even GNU Social can serve nodeinfo via a plugin; see, for example, https://gnusocial.cc/.

Noo, was hoping to get Mastodon behind ServiceInfo, but was moving too slowly :(

Was this page helpful?
0 / 5 - 0 ratings

Related issues

strugee picture strugee  路  76Comments

ashfurrow picture ashfurrow  路  73Comments

SelfsameSynonym picture SelfsameSynonym  路  96Comments

BrianPansky picture BrianPansky  路  69Comments

Gargron picture Gargron  路  121Comments