Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Fedi Redirect
- // @namespace http://tampermonkey.net/
- // @description Redirect Fediverse links to thebrainbin.org search; also redirects Bluesky and forks to Skyview, and www.reddit.com links to old.reddit.com
- // @author Grok (initial draft), [email protected] (updates)
- // @version 0.3
- // @match https://www.reddit.com/*
- // @match https://reddit.com/*
- // @match https://lemmy.myserv.one/post/*
- // @match https://xn--baw-joa.social/@*
- // @match https://lemmy.world/comment/*
- // @match https://social.horrorhub.club/@*
- // @match https://lemmus.org/post/*
- // @match https://mastodon.xyz/@*
- // @match https://mastodon.catgirl.cloud/@*
- // @match https://lemmings.world/post/*
- // @match https://zirk.us/@*
- // @match https://nerdculture.de/@*
- // @match https://feddit.online/post/*
- // @match https://feddit.dk/post/*
- // @match https://toot.finfur.net/@*
- // @match https://europe.pub/post/*
- // @match https://social.sdf.org/@*
- // @match https://mastodon.well.com/@*
- // @match https://lea.pet/notes/*
- // @match https://social.heise.de/@*
- // @match https://pawoo.net/@*
- // @match https://exquisite.social/@*
- // @match https://pogs.cafe/@*
- // @match https://defcon.social/@*
- // @match https://libretechni.ca/post/*
- // @match https://nijimiss.moe/notes/*
- // @match https://lemy.lol/post/*
- // @match https://mast.interfacinglinux.com/@*
- // @match https://retro.pizza/@*
- // @match https://mastodon.bot/@*
- // @match https://mastodon.online/@*
- // @match https://linuxrocks.online/@*
- // @match https://digipres.club/@*
- // @match https://lgbtqia.space/@*
- // @match https://ttrpg.network/post/*
- // @match https://chaos.social/@*
- // @match https://reddthat.com/post/*
- // @match https://lazysoci.al/post/*
- // @match https://lemmy.blackeco.com/post/*
- // @match https://lemmy.org/post/*
- // @match https://misskey.flowers/notes/*
- // @match https://lemmy.ca/post/*
- // @match https://retrochat.online/@*
- // @match https://gamerstavern.online/@*
- // @match https://jlai.lu/post/*
- // @match https://thecanadian.social/@*
- // @match https://awful.systems/post/*
- // @match https://feddit.uk/post/*
- // @match https://brands.town/@FoxNews/*
- // @match https://social.treehouse.systems/@*
- // @match https://dosgame.club/@*
- // @match https://ibbit.at/post/*
- // @match https://explore.alt.store/@*
- // @match https://fosstodon.org/@*
- // @match https://piefed.blahaj.zone/comment/*
- // @match https://scicomm.xyz/@*
- // @match https://techhub.social/@*
- // @match https://meow.social/@*
- // @match https://retrolemmy.com/post/*
- // @match https://piaille.fr/@*
- // @match https://mander.xyz/post/*
- // @match https://hilariouschaos.com/post/*
- // @match https://lemmy.one/post/*
- // @match https://cyberpunk.lol/@*
- // @match https://flipboard.social/@*
- // @match https://lemmy.zip/post/*
- // @match https://swiss.social/@*
- // @match https://lemmy.cafe/post/*
- // @match https://bookwyr.me/post/*
- // @match https://lemmy.linuxuserspace.show/post/*
- // @match https://piefed.ca/c/*/p/*
- // @match https://cyberplace.social/@*
- // @match https://bolha.one/@*
- // @match https://retro.social/@*
- // @match https://lemdro.id/post/*
- // @match https://ani.social/post/*
- // @match https://piefed.blahaj.zone/post/*
- // @match https://lemmy.curiana.net/post/*
- // @match https://feddit.bg/post/*
- // @match https://federate.social/@*
- // @match https://cafe.coffee-break.cc/c/*/p/*
- // @match https://mastodon.social/@*
- // @match https://piefed.blahaj.zone/c/*/p/*
- // @match https://eldritch.cafe/@*
- // @match https://bsky.app/profile/*post/*
- // @match https://lemmy.bestiver.se/post/*
- // @match https://thelemmy.club/post/*
- // @match https://pawb.social/post/*
- // @match https://https://piefed.ca/c/*/p/*
- // @match https://mindly.social/@*
- // @match https://socel.net/@*
- // @match https://piefed.world/post/*
- // @match https://twit.social/@*
- // @match https://mastodon.tomodori.net/@*
- // @match https://neurodifferent.me/@*
- // @match https://midwest.social/post/*
- // @match https://wetdry.world/@*
- // @match https://suppo.fi/post/*
- // @match https://social.beeps.gay/@*
- // @match https://piefed.world/c/*/p/*
- // @match https://feddit.org/post/*
- // @match https://ohai.social/@*
- // @match https://lemmy.ohaa.xyz/post/*
- // @match https://oomfie.city/@*
- // @match https://infosec.pub/post/*
- // @match https://sh.itjust.works/post/*
- // @match https://toast.ooo/post/*
- // @match https://grapheneos.social/@*
- // @match https://mastodon.uno/@*
- // @match https://jemmy.jeena.net/post/*
- // @match https://social.brian.jp/@*
- // @match https://furry.engineer/@*
- // @match https://lemmit.online/post/*
- // @match https://feddit.it/post/*
- // @match https://mastodon.world/@*
- // @match https://programming.dev/post/*
- // @match https://werd.social/@*
- // @match https://sopuli.xyz/post/*
- // @match https://piefed.social/c/*/p/*
- // @match https://piefed.ca/post/*
- // @match https://moist.catsweat.com/m/*/t/*
- // @match https://lemmy.blahaj.zone/post/*
- // @match https://lemmy.dbzer0.com/post/*
- // @match https://lemmy.ml/post/*
- // @match https://biglemmowski.win/post/*
- // @match https://discuss.tchncs.de/post/*
- // @match https://alien.top/post/*
- // @match https://framapiaf.org/@*
- // @match https://floss.social/@*
- // @match https://mastodon.gamedev.place/@*
- // @match https://misskey.io/notes/*
- // @match https://goblin.band/notes/*
- // @match https://pixelfed.social/p/*
- // @match https://rss-parrot.net/u/*
- // @match https://vt.social/@*
- // @match https://mstdn.games/@*
- // @match https://universeodon.com/@*
- // @match https://mstdn.social/@*
- // @match https://corteximplant.com/@*
- // @match https://baraag.net/@*
- // @match https://infosec.exchange/@*
- // @match https://mas.to/@*
- // @match https://things.uk/@*
- // @match https://lemmy.world/post/*
- // @match https://mastodon.art/@*
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- const url = new URL(window.location.href);
- const path = url.pathname;
- let match;
- // Check for the Mastodon pattern
- match = path.match(/^\/@(.+)$/);
- if (match) {
- const searchUrl = `https://thebrainbin.org/search?search[q]=${url.origin}${path}`;
- window.location.replace(searchUrl);
- return; // Exit after redirecting
- }
- // Check for the Lemmy and Piefed's shared post pattern (other patterns below)
- match = path.match(/^\/post\/(.+)$/);
- if (match) {
- const searchUrl = `https://thebrainbin.org/search?search[q]=${url.origin}${path}`;
- window.location.replace(searchUrl);
- return; // Exit after redirecting
- }
- // Check for the Pixelfed pattern
- match = path.match(/^\/p\/(.+)$/);
- if (match) {
- const searchUrl = `https://thebrainbin.org/search?search[q]=${url.origin}${path}`;
- window.location.replace(searchUrl);
- return; // Exit after redirecting
- }
- // Check for the Misskey pattern
- match = path.match(/^\/notes\/(.+)$/);
- if (match) {
- const searchUrl = `https://thebrainbin.org/search?search[q]=${url.origin}${path}`;
- window.location.replace(searchUrl);
- return; // Exit after redirecting
- }
- // Check for the RSS Parrot pattern
- match = path.match(/^\/u\/(.+)$/);
- if (match) {
- const searchUrl = `https://thebrainbin.org/search?search[q]=${url.origin}${path}`;
- window.location.replace(searchUrl);
- return; // Exit after redirecting
- }
- // Check for the Mbin pattern
- match = path.match(/^\/m\/[^/]+\/t\/(.+)/);
- if (match) {
- const searchUrl = `https://thebrainbin.org/search?search[q]=${url.origin}${path}`;
- window.location.replace(searchUrl);
- return; // Exit after redirecting
- }
- // Check for the Piefed pattern #2
- match = path.match(/^\/c\/[^/]+\/p\/(.+)/);
- if (match) {
- const searchUrl = `https://thebrainbin.org/search?search[q]=${url.origin}${path}`;
- window.location.replace(searchUrl);
- return; // Exit after redirecting
- }
- // Check for the Piefed and Lemmy comment pattern
- match = path.match(/^\/comment\/(.+)$/);
- if (match) {
- const searchUrl = `https://thebrainbin.org/search?search[q]=${url.origin}${path}`;
- window.location.replace(searchUrl);
- return; // Exit after redirecting
- }
- // Check for the Bluesky pattern
- match = path.match(/^\/profile\/[^/]+\/post\/(.+)/);
- if (match) {
- const searchUrl = `https://skyview.social/?url=${url.origin}${path}`;
- window.location.replace(searchUrl);
- return; // Exit after redirecting
- }
- // Check for the Reddit pattern
- match = path.match(`https://(?:www\.)?reddit\.com/`);
- if (match) {
- const searchUrl = `https://old.reddit.com/`;
- window.location.replace(searchUrl);
- return; // Exit after redirecting
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment