this post was submitted on 24 Jun 2023
53 points (92.1% liked)

Lemmy

2172 readers
39 users here now

Everything about Lemmy; bugs, gripes, praises, and advocacy.

For discussion about the lemmy.ml instance, go to [email protected].

founded 4 years ago
MODERATORS
 

The issue: You find a link to a neat lemmy community on some random instance. In order to subscribe, you have go to your instance, search for the community, find it, open it, subscribe...blah!

The fix: Use a simple browser bookmark to go to your home instance and open the federated community in one click.

This works through modifying the URL of the page your on and puts the host name (e.g. lemmy.ml) after an "@" symbol after the community and then changing the host name to your own, hard-coded one.

How to steps:

  1. Create a bookmark in your browser and then "Edit" it.

  2. Change the URL to this text (modify the "lemmy.world" bit with whatever your home instance is):

    For lemmy.world users: javascript:(function(){location.href="https://lemmy.world/c/"+location.href.match(/(?:.*)\/c\/(.*(?=\/)|.*$)/i)[1]+"@"+location.host.toString();})();

    For lemmy.ml users: javascript:(function(){location.href="https://lemmy.ml/c/"+location.href.match(/(?:.*)\/c\/(.*(?=\/)|.*$)/i)[1]+"@"+location.host.toString();})();

  3. Change the name of the bookmark to whatever you want. Mine is named "lemmy.world".

  1. You're all set!

Now, from any federated community main feed page, click on the bookmark and you'll magically be taken to the same community on your local instance. Magic!


Disclaimers: The community must be federated with your instance. You can only do this from a URL that has the community in url (e.g. not from a post or anything).

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 19 points 1 year ago (3 children)

This is neat, but it should really be part of Lemmy to be able to link between instances in a way that rewrites the link to your own instance, and makes subscribing easier.

[–] swab148 6 points 1 year ago

True, then it could be implemented via the app, which would make adoption by new users much more palatable.

[–] [email protected] 5 points 1 year ago (1 children)

Lemmy v0.18 has this, however not everyone's doing it.

Old lemmy can do it with /c/ or /u/ links, eg [Link text](/c/community@instance) or [Link text](/u/user@instance)

[–] [email protected] 1 points 1 year ago
[–] ewe 1 points 1 year ago

Yes, but the problem is Lemmy doesn't inherently know which instance your user is from. Maybe they can fix it in the future, but I don't see how. When you visit another instance, you are there and there's no sharing context to know that a particular user is actually from "xyz" instance.

This fixes it because you can just tailor your bookmark based on your home instance.