cross-posted from: https://feddit.de/post/808717

I made a little thing to more easily move to another instance:

A way to quickly grab a list of your subscribed communities.

Go to your list of subscribed communities, <yourinstance>/communities/listing_type/Subscribed/page/1 and create a bookmark with the following code as link:

code
javascript:(function() {
    const currentHostname = window.location.hostname;
    const table = document.getElementById('community_table');
    const anchorTags = table.getElementsByTagName('a');
    const communityUrls = [];

    for (let i = 0; i < anchorTags.length; i++) {
      const title = anchorTags[i].title.substring(1);
      const parts = title.split('@');
      const community = parts[0].trim();
      const domain = parts[1] ? parts[1].trim() : currentHostname;
      const communityUrl = `https://${domain}/c/${community}`;
      communityUrls.push(communityUrl);
    }

    const urlsText = communityUrls.join('\n');

    navigator.clipboard.writeText(urlsText)
      .then(() => {
        alert('Community URLs copied to clipboard!');
      })
      .catch((error) => {
        alert('Failed to copy Community URLs to clipboard:', error);
      });
})();

Clicking this bookmark will automatically copy a list of all your subscribed communities and format the links so that you can pop them in the search bar of another instance to subscribe to them from another account.

It can only scrape what’s on screen, so if your subscribed communities list is several pages long just click the bookmark for each page.

  • GodM
    link
    English
    31 year ago

    oh nice trick, i didn’t know you could spoiler things like that

    test

    test successful

    • mershed_perderdersOPM
      link
      English
      21 year ago

      Neat! I’m a little disappointed with the cross-posting attribution.

      • GodM
        link
        English
        21 year ago

        I’m not even sure that there’s any importance in keeping the default attribution. I even modified it a little bit here