i find it annoying to have to manually change urls to subscribe to a community outside lemmy.world, so i wrote a bookmarklet to quickly switch to the lemmy.world instance

to use, just drag the following code to your bookmarks bar (name it whatever you like), then click it when you want to use it

javascript:(function() {const myInst="lemmy.world";let currUrl=window.location.toString().split("/");let currInst=currUrl[2];currUrl[2]=myInst;let newUrl=currUrl.join("/")+"@"+currInst;window.location=newUrl;})();

readable version:

javascript:(
	function() {
		// make sure to change this if using on a different instance
		const myInst="lemmy.world";
		let currUrl=window.location.toString().split("/");
		let currInst=currUrl[2];
		currUrl[2]=myInst;
		let newUrl=currUrl.join("/")+"@"+currInst;
		window.location=newUrl;
	})
()
  • God
    link
    fedilink
    English
    2
    edit-2
    1 year ago

    do you know of any way to switch not a community but a post to another instance? afaik they’re numeric so the number identifier is different on each instance which makes it hard.

    • ⱿeusOP
      link
      fedilink
      English
      2
      edit-2
      1 year ago

      i’m afraid i don’t. i did fiddle around a bit trying to find a relationship between url’s, but I couldn’t see one

      if anyone more familiar with lemmy/activitypub can tell me, I’ll update / add to the bookmarklet

      • God
        link
        fedilink
        English
        21 year ago

        You probably understood me the first time but I’m editing because I made a mistake in how I phrased it.

        to another communityinstance

        the number identifier is different on each communityinstance

        • ⱿeusOP
          link
          fedilink
          English
          11 year ago

          i’m glad that’s being tracked, as a bookmarklet is not really a great solution; but it’s still not a complete solution. if i visit a lemmy post from outside lemmy.world (e.g. search engine), then there’s no way to go to the l.w version (to my knowledge)