_Auster_

Fedi Redirect userscript

Apr 27th, 2026 (edited)
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.60 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Fedi Redirect
  3. // @namespace http://tampermonkey.net/
  4. // @description Redirect Fediverse links to thebrainbin.org search; also redirects Bluesky and forks to Skyview, and www.reddit.com links to old.reddit.com
  5. // @author Grok (initial draft), [email protected] (updates)
  6. // @version 0.3
  7. // @match https://www.reddit.com/*
  8. // @match https://reddit.com/*
  9. // @match https://lemmy.myserv.one/post/*
  10. // @match https://xn--baw-joa.social/@*
  11. // @match https://lemmy.world/comment/*
  12. // @match https://social.horrorhub.club/@*
  13. // @match https://lemmus.org/post/*
  14. // @match https://mastodon.xyz/@*
  15. // @match https://mastodon.catgirl.cloud/@*
  16. // @match https://lemmings.world/post/*
  17. // @match https://zirk.us/@*
  18. // @match https://nerdculture.de/@*
  19. // @match https://feddit.online/post/*
  20. // @match https://feddit.dk/post/*
  21. // @match https://toot.finfur.net/@*
  22. // @match https://europe.pub/post/*
  23. // @match https://social.sdf.org/@*
  24. // @match https://mastodon.well.com/@*
  25. // @match https://lea.pet/notes/*
  26. // @match https://social.heise.de/@*
  27. // @match https://pawoo.net/@*
  28. // @match https://exquisite.social/@*
  29. // @match https://pogs.cafe/@*
  30. // @match https://defcon.social/@*
  31. // @match https://libretechni.ca/post/*
  32. // @match https://nijimiss.moe/notes/*
  33. // @match https://lemy.lol/post/*
  34. // @match https://mast.interfacinglinux.com/@*
  35. // @match https://retro.pizza/@*
  36. // @match https://mastodon.bot/@*
  37. // @match https://mastodon.online/@*
  38. // @match https://linuxrocks.online/@*
  39. // @match https://digipres.club/@*
  40. // @match https://lgbtqia.space/@*
  41. // @match https://ttrpg.network/post/*
  42. // @match https://chaos.social/@*
  43. // @match https://reddthat.com/post/*
  44. // @match https://lazysoci.al/post/*
  45. // @match https://lemmy.blackeco.com/post/*
  46. // @match https://lemmy.org/post/*
  47. // @match https://misskey.flowers/notes/*
  48. // @match https://lemmy.ca/post/*
  49. // @match https://retrochat.online/@*
  50. // @match https://gamerstavern.online/@*
  51. // @match https://jlai.lu/post/*
  52. // @match https://thecanadian.social/@*
  53. // @match https://awful.systems/post/*
  54. // @match https://feddit.uk/post/*
  55. // @match https://brands.town/@FoxNews/*
  56. // @match https://social.treehouse.systems/@*
  57. // @match https://dosgame.club/@*
  58. // @match https://ibbit.at/post/*
  59. // @match https://explore.alt.store/@*
  60. // @match https://fosstodon.org/@*
  61. // @match https://piefed.blahaj.zone/comment/*
  62. // @match https://scicomm.xyz/@*
  63. // @match https://techhub.social/@*
  64. // @match https://meow.social/@*
  65. // @match https://retrolemmy.com/post/*
  66. // @match https://piaille.fr/@*
  67. // @match https://mander.xyz/post/*
  68. // @match https://hilariouschaos.com/post/*
  69. // @match https://lemmy.one/post/*
  70. // @match https://cyberpunk.lol/@*
  71. // @match https://flipboard.social/@*
  72. // @match https://lemmy.zip/post/*
  73. // @match https://swiss.social/@*
  74. // @match https://lemmy.cafe/post/*
  75. // @match https://bookwyr.me/post/*
  76. // @match https://lemmy.linuxuserspace.show/post/*
  77. // @match https://piefed.ca/c/*/p/*
  78. // @match https://cyberplace.social/@*
  79. // @match https://bolha.one/@*
  80. // @match https://retro.social/@*
  81. // @match https://lemdro.id/post/*
  82. // @match https://ani.social/post/*
  83. // @match https://piefed.blahaj.zone/post/*
  84. // @match https://lemmy.curiana.net/post/*
  85. // @match https://feddit.bg/post/*
  86. // @match https://federate.social/@*
  87. // @match https://cafe.coffee-break.cc/c/*/p/*
  88. // @match https://mastodon.social/@*
  89. // @match https://piefed.blahaj.zone/c/*/p/*
  90. // @match https://eldritch.cafe/@*
  91. // @match https://bsky.app/profile/*post/*
  92. // @match https://lemmy.bestiver.se/post/*
  93. // @match https://thelemmy.club/post/*
  94. // @match https://pawb.social/post/*
  95. // @match https://https://piefed.ca/c/*/p/*
  96. // @match https://mindly.social/@*
  97. // @match https://socel.net/@*
  98. // @match https://piefed.world/post/*
  99. // @match https://twit.social/@*
  100. // @match https://mastodon.tomodori.net/@*
  101. // @match https://neurodifferent.me/@*
  102. // @match https://midwest.social/post/*
  103. // @match https://wetdry.world/@*
  104. // @match https://suppo.fi/post/*
  105. // @match https://social.beeps.gay/@*
  106. // @match https://piefed.world/c/*/p/*
  107. // @match https://feddit.org/post/*
  108. // @match https://ohai.social/@*
  109. // @match https://lemmy.ohaa.xyz/post/*
  110. // @match https://oomfie.city/@*
  111. // @match https://infosec.pub/post/*
  112. // @match https://sh.itjust.works/post/*
  113. // @match https://toast.ooo/post/*
  114. // @match https://grapheneos.social/@*
  115. // @match https://mastodon.uno/@*
  116. // @match https://jemmy.jeena.net/post/*
  117. // @match https://social.brian.jp/@*
  118. // @match https://furry.engineer/@*
  119. // @match https://lemmit.online/post/*
  120. // @match https://feddit.it/post/*
  121. // @match https://mastodon.world/@*
  122. // @match https://programming.dev/post/*
  123. // @match https://werd.social/@*
  124. // @match https://sopuli.xyz/post/*
  125. // @match https://piefed.social/c/*/p/*
  126. // @match https://piefed.ca/post/*
  127. // @match https://moist.catsweat.com/m/*/t/*
  128. // @match https://lemmy.blahaj.zone/post/*
  129. // @match https://lemmy.dbzer0.com/post/*
  130. // @match https://lemmy.ml/post/*
  131. // @match https://biglemmowski.win/post/*
  132. // @match https://discuss.tchncs.de/post/*
  133. // @match https://alien.top/post/*
  134. // @match https://framapiaf.org/@*
  135. // @match https://floss.social/@*
  136. // @match https://mastodon.gamedev.place/@*
  137. // @match https://misskey.io/notes/*
  138. // @match https://goblin.band/notes/*
  139. // @match https://pixelfed.social/p/*
  140. // @match https://rss-parrot.net/u/*
  141. // @match https://vt.social/@*
  142. // @match https://mstdn.games/@*
  143. // @match https://universeodon.com/@*
  144. // @match https://mstdn.social/@*
  145. // @match https://corteximplant.com/@*
  146. // @match https://baraag.net/@*
  147. // @match https://infosec.exchange/@*
  148. // @match https://mas.to/@*
  149. // @match https://things.uk/@*
  150. // @match https://lemmy.world/post/*
  151. // @match https://mastodon.art/@*
  152. // @grant none
  153. // ==/UserScript==
  154.  
  155. (function() {
  156. 'use strict';
  157.  
  158. const url = new URL(window.location.href);
  159. const path = url.pathname;
  160. let match;
  161.  
  162. // Check for the Mastodon pattern
  163. match = path.match(/^\/@(.+)$/);
  164. if (match) {
  165. const searchUrl = `https://thebrainbin.org/search?search[q]=${url.origin}${path}`;
  166. window.location.replace(searchUrl);
  167. return; // Exit after redirecting
  168. }
  169.  
  170. // Check for the Lemmy and Piefed's shared post pattern (other patterns below)
  171. match = path.match(/^\/post\/(.+)$/);
  172. if (match) {
  173. const searchUrl = `https://thebrainbin.org/search?search[q]=${url.origin}${path}`;
  174. window.location.replace(searchUrl);
  175. return; // Exit after redirecting
  176. }
  177.  
  178. // Check for the Pixelfed pattern
  179. match = path.match(/^\/p\/(.+)$/);
  180. if (match) {
  181. const searchUrl = `https://thebrainbin.org/search?search[q]=${url.origin}${path}`;
  182. window.location.replace(searchUrl);
  183. return; // Exit after redirecting
  184. }
  185.  
  186. // Check for the Misskey pattern
  187. match = path.match(/^\/notes\/(.+)$/);
  188. if (match) {
  189. const searchUrl = `https://thebrainbin.org/search?search[q]=${url.origin}${path}`;
  190. window.location.replace(searchUrl);
  191. return; // Exit after redirecting
  192. }
  193.  
  194. // Check for the RSS Parrot pattern
  195. match = path.match(/^\/u\/(.+)$/);
  196. if (match) {
  197. const searchUrl = `https://thebrainbin.org/search?search[q]=${url.origin}${path}`;
  198. window.location.replace(searchUrl);
  199. return; // Exit after redirecting
  200. }
  201.  
  202. // Check for the Mbin pattern
  203. match = path.match(/^\/m\/[^/]+\/t\/(.+)/);
  204. if (match) {
  205. const searchUrl = `https://thebrainbin.org/search?search[q]=${url.origin}${path}`;
  206. window.location.replace(searchUrl);
  207. return; // Exit after redirecting
  208. }
  209.  
  210. // Check for the Piefed pattern #2
  211. match = path.match(/^\/c\/[^/]+\/p\/(.+)/);
  212. if (match) {
  213. const searchUrl = `https://thebrainbin.org/search?search[q]=${url.origin}${path}`;
  214. window.location.replace(searchUrl);
  215. return; // Exit after redirecting
  216. }
  217.  
  218. // Check for the Piefed and Lemmy comment pattern
  219. match = path.match(/^\/comment\/(.+)$/);
  220. if (match) {
  221. const searchUrl = `https://thebrainbin.org/search?search[q]=${url.origin}${path}`;
  222. window.location.replace(searchUrl);
  223. return; // Exit after redirecting
  224. }
  225.  
  226. // Check for the Bluesky pattern
  227. match = path.match(/^\/profile\/[^/]+\/post\/(.+)/);
  228. if (match) {
  229. const searchUrl = `https://skyview.social/?url=${url.origin}${path}`;
  230. window.location.replace(searchUrl);
  231. return; // Exit after redirecting
  232. }
  233.  
  234. // Check for the Reddit pattern
  235. match = path.match(`https://(?:www\.)?reddit\.com/`);
  236. if (match) {
  237. const searchUrl = `https://old.reddit.com/`;
  238. window.location.replace(searchUrl);
  239. return; // Exit after redirecting
  240. }
  241.  
  242. })();
  243.  
Advertisement
Add Comment
Please, Sign In to add comment