I don’t know if it’s possible on sh.itjust.works, or if it’s better to ask this to Lemmy devs directly, but would it be possible to detect and convert automatically links to communities and posts so that when clicking on them, we are redirected to them in sh.itjust.works view of them, being able to interact with them ?

Example: detect that c/main@sh.itjust.works or !main@sh.itjust.works are lemmy community links, and so, HTMLify them to link to https://sh.itjust.works/c/main@sh.itjust.works

Another example: c/newcommunities@lemmy.world or !newcommunities@lemmy.world to be transformed as a link to https://sh.itjust.works/c/newcommunities@lemmy.world

This does not need to know what url are lemmy or not, simply having an url beginning with “c/” or “/c/” or “!” and containing a “@” could be transformed to a clickable link, without needing the user to do copy paste and changing and stuff to access the link that can be provided by any other users on other federations

Current best way is for the user that post a message, to write the link in this format [some title](/c/xxx@fede.xx), other formats will not be recognized, and full urls beginning with http will change the website (so we are no more able to act).

  • abraxas@lemmy.ml
    link
    fedilink
    English
    arrow-up
    6
    ·
    1 year ago

    Yeah, this is a common issue. Even if you know to link, many people don’t. Nothing like having a bunch of egress-links where you end up in another instance.

    Perhaps it’d be mitigated if you could use lemmy instance as a client for your own login and somehow “share” the credentials between them. But that doesn’t seem to be happening either.

    • Difficult_Bit_1339@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 year ago

      Using ! then the community name creates a proper universal link, but the script is broken and you have to manually edit it: https://lemmy.sdf.org/post/36299

      Ideally the instance software should allow a user to set a ‘automatically resolve community egress links locally’ option. Until then it’ll annoy regular users who’re not going to bother with greasemonkey userscripts.

      Oh, the exciting world of being an early adopter!

    • Jakylla@sh.itjust.worksOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 year ago

      Thanks ! Following your links, I’ve made my own userscript to find !community@instance and /c/community@instance in the page on load, and replace them with links to where they redirect (using sh.itjust.works urls)

      Unfortunately, I didn’t find a way to do it for links to posts :( But at least, for communities, it will work

      If interested: https://pastebin.com/Q4dxHMEe

      As an example, this very post becomes:

      • God@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        Very nice :))) Sad that we never get the idea on how to do posts. I know that it’s possible to search a post or comment link from any instance to find it (image below), but afaik this is not possible through the API even if you’re authenticated. I’ve tried a lot. I’ll probably use your script :) Let’s see how it goes. Thank you for sharing!

  • Wander@yiffit.net
    link
    fedilink
    English
    arrow-up
    3
    ·
    1 year ago

    Here is a userscript that makes this work:

    https://sh.itjust.works/post/33762 (just make sure to change the home instance variable).

    And also recommended, to find previously undiscovered communities when your instance gives you a 404 and fetch them for the first time: https://reddthat.com/post/69331

    You will need greasemonkey for firefox or tampermonkey for chrome. Plug those scripts in and they’ll do the work for you by rewriting the urls.