lemmy
lemmy copied to clipboard
Implement some sort of programmatic way to recognize that a site uses Lemmy
Requirements
- [X] Is this a feature request? For questions or discussions use https://lemmy.ml/c/lemmy_support
- [X] Did you check to see if this issue already exists?
- [X] Is this only a feature request? Do not put multiple feature requests in one issue.
- [ ] Is this a UI / front end issue? Use the lemmy-ui repo.
Is your proposal related to a problem?
Currently every client/frontend I've seen has issues opening links to other instances. I think it would be useful if clients could detect if a link was to another instance and render it in-client instead of as a webpage.
Describe the solution you'd like.
Best idea I can think of is a url like /lemmy
which could return info about the current instance. If it returns valid JSON, clients can can then attempt to treat it as a Lemmy instance.
Describe alternatives you've considered.
I suppose you could also create a centralized list or something, but that kinda defeats the point of the platform.
Additional context
If this does get implemented, I've been thinking of writing a small self-hosted app that would basically just ask you for your favorite instance and save that info locally, then subsequently redirect you to that instance automatically.
The HTML5 spec includes a meta tag for this purpose and it is widely used.
https://html.spec.whatwg.org/multipage/semantics.html#standard-metadata-names
e.g. <meta name="generator" content="Lemmy" />
or
<meta name="generator" content="Drupal 7" />
The HTML5 spec includes a meta tag for this purpose and it is widely used.
https://html.spec.whatwg.org/multipage/semantics.html#standard-metadata-names
e.g.
<meta name="generator" content="Lemmy" />
or<meta name="generator" content="Drupal 7" />
That's true. I wonder if we could introduce some custom metadata that tells you the version and other metadata like whether the community shows upvotes, whether the community allows you to create a subreddit, how many instances are Federated, etc.
% curl -H "Accept: application/activity+json" https://lemmy.ml/.well-known/nodeinfo
{"links":[{"rel":"http://nodeinfo.diaspora.software/ns/schema/2.0","href":"https://lemmy.ml/nodeinfo/2.0.json"}]}
% curl -H "Accept: application/activity+json" https://lemmy.ml/nodeinfo/2.0.json
{"version":"2.0","software":{"name":"lemmy","version":"0.17.4"},"protocols":["activitypub"],"usage":{"users":{"total":36827,"activeHalfyear":4166,"activeMonth":3695},"localPosts":82253,"localComments":177090},"openRegistrations":false}
No need to reinvent the wheel and injecting additional data into the HTML page when the server already discloses information about the instance.
Exactly, use nodeinfo. Including data in html would have to be done in lemmy-ui.