In case it helps anyone else, here’s a little bookmarklet I created using ChatGPT which performs the chore of searching your chosen Lemmy instance for the names of subreddits to which you’re subscribed.

(Modify instance to your chosen Lemmy instance.)

javascript:(function(){
    if (window.location.href !== "https://www.reddit.com/subreddits") {
    alert("You must be on the reddit.com/subreddits page.");
    return;
  } else {
    var instance = "lemmy.world";
    var links = document.getElementsByTagName('a');
    for (var i = 0; i < links.length; i++) {
      if (links[i].href.indexOf('+') !== -1) {
        var url = links[i].href;
        var parameters = url.split('+');
        var newUrl = '';
        for (var j = 1; j < parameters.length; j++) {
          newUrl += 'https://' + instance + '/search/q/' + parameters[j] + '/type/Communities/sort/TopAll/listing_type/All/community_id/0/creator_id/0/page/1\n';
        }
        navigator.clipboard.writeText(newUrl).then(function() {
          alert("Copy operation successful! Paste results at openallurls.com (or other multiple URL opening service.)");
        }, function() {
          alert("Copy operation unsuccessful!");
        });
        break;
      }
    }
  }
})();

I got the idea from this bookmarklet which copies your Lemmy subscriptions if you decide to change instances.

I think it could be improved by providing links to something like https://lemmyverse.net/communities to search instead, but I couldn’t figure out how to pass the subreddit name parameter in the Url.

  • @Gamera8IDOP
    link
    English
    21 year ago

    Remember to modify var instance = "lemmy.world"; to var instance = "lemm.ee"; for your Lemmy instance.