4
submitted 1 year ago* (last edited 1 year ago) by Gamera8ID@lemmy.world to c/reddit@lemmy.world

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.

top 4 comments
sorted by: hot top controversial new old
[-] ex0dus 1 points 1 year ago

You should modify it to replace the query string in https://lemmyverse.net/communities?query=Programming for example, all you do is url encode the query and put it on the end

[-] JohnnyEnzyme@lemm.ee 0 points 1 year ago

Whoa, this could be useful!

Um, unfortunately I know very little about JavaScript, nor how to get that piece of code to run. Any advice on that?

Btw, it would also be highly useful to copy over the various subs in my 12+ MultiReddits.

[-] Gamera8ID@lemmy.world 1 points 1 year ago
[-] Gamera8ID@lemmy.world 2 points 1 year ago

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

this post was submitted on 20 Jun 2023
4 points (100.0% liked)

Reddit

17701 readers
55 users here now

News and Discussions about Reddit

Welcome to !reddit. This is a community for all news and discussions about Reddit.

The rules for posting and commenting, besides the rules defined here for lemmy.world, are as follows:

Rules


Rule 1- No brigading.

**You may not encourage brigading any communities or subreddits in any way. **

YSKs are about self-improvement on how to do things.



Rule 2- No illegal or NSFW or gore content.

**No illegal or NSFW or gore content. **



Rule 3- Do not seek mental, medical and professional help here.

Do not seek mental, medical and professional help here. Breaking this rule will not get you or your post removed, but it will put you at risk, and possibly in danger.



Rule 4- No self promotion or upvote-farming of any kind.

That's it.



Rule 5- No baiting or sealioning or promoting an agenda.

Posts and comments which, instead of being of an innocuous nature, are specifically intended (based on reports and in the opinion of our crack moderation team) to bait users into ideological wars on charged political topics will be removed and the authors warned - or banned - depending on severity.



Rule 6- Regarding META posts.

Provided it is about the community itself, you may post non-Reddit posts using the [META] tag on your post title.



Rule 7- You can't harass or disturb other members.

If you vocally harass or discriminate against any individual member, you will be removed.

Likewise, if you are a member, sympathiser or a resemblant of a movement that is known to largely hate, mock, discriminate against, and/or want to take lives of a group of people, and you were provably vocal about your hate, then you will be banned on sight.



Rule 8- All comments should try to stay relevant to their parent content.



Rule 9- Reposts from other platforms are not allowed.

Let everyone have their own content.



:::spoiler Rule 10- Majority of bots aren't allowed to participate here.

founded 1 year ago
MODERATORS