Last active
July 29, 2025 16:24
-
-
Save examosa/50eb28bc16a006b62b3f43893ab457e7 to your computer and use it in GitHub Desktop.
Userscripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const cdn = (path) => new URL(path, 'https://nobsdelivr.private.coffee/'); | |
const withCatch = | |
(action) => | |
(...args) => | |
Promise.try(action, ...args).catch((error) => { | |
console.error('Caught error:', error); | |
}); | |
const getJson = withCatch((url) => | |
fetch(url, { headers: { Accept: 'application/json' } }).then((response) => | |
response.json(), | |
), | |
); | |
async function testBackups() { | |
const backups = [ | |
'https://jsonblob.com/api/jsonBlob/1392945386074857472', | |
'https://api.npoint.io/6ee2cb1b5a1aa6f10be5', | |
'https://api.pastes.dev/VSjbFP63yq', | |
'https://api.codetabs.com/v1/proxy/?quest=https%3A%2F%2Fstarb.in%2Fraw%2FMgDjym', | |
'https://bytebin.lucko.me/bDAxqrUNqD', | |
]; | |
const results = await Promise.all(backups.map((backup) => getJson(backup))); | |
for (const index of results.keys()) { | |
const result = results[index]; | |
if (!result) { | |
const backup = backups[index]; | |
console.warn(`Stale backup: ${backup}`); | |
} | |
} | |
} | |
async function fetchInstances() { | |
const instances = { | |
ducksforducks: ['https://ducksforducks.private.coffee'], | |
nerdsfornerds: ['https://nn.vern.cc'], | |
}; | |
const providers = { | |
libredirect: { | |
source: 'libredirect/instances/data.json', | |
normalize: (result) => | |
Object.entries(result).map(([name, instances]) => ({ | |
type: name.toLowerCase(), | |
instances: instances.clearnet, | |
})), | |
}, | |
farside: { | |
source: 'benbusby/farside/services.json', | |
normalize: (result) => | |
result.map((service) => ({ | |
type: service.type, | |
instances: service.instances.concat(service.fallback), | |
})), | |
}, | |
fastside: { | |
source: 'cofob/fastside/services.json', | |
normalize: (result) => | |
result.services.map((service) => ({ | |
type: service.type, | |
instances: service.instances | |
.filter((instance) => instance.tags.includes('clearnet')) | |
.map((instance) => instance.url), | |
})), | |
}, | |
}; | |
const promises = Object.values(providers).map(async (provider) => { | |
const result = await getJson(cdn(`gh/${provider.source}`)); | |
if (!result) { | |
return []; | |
} | |
return provider.normalize(result); | |
}); | |
const sources = await Promise.all(promises); | |
for (const source of sources.flat()) { | |
const list = (instances[source.type] ??= []); | |
for (const url of source.instances) { | |
if (!list.includes(url)) { | |
list.push(url); | |
} | |
} | |
} | |
return instances; | |
} | |
await testBackups(); | |
await fetchInstances(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Shortside | |
// @version 1.3.0 | |
// @description Redirects the configured websites to third-party privacy-respecting front ends. | |
// @author examosa | |
// @license AGPLv3-or-later | |
// @updateUrl https://gist.github.com/examosa/50eb28bc16a006b62b3f43893ab457e7/raw/shortside.user.js | |
// @downloadUrl https://gist.github.com/examosa/50eb28bc16a006b62b3f43893ab457e7/raw/shortside.user.js | |
// @match https://www.fandom.com/* | |
// @match https://www.geeksforgeeks.org/* | |
// @match https://genius.com/* | |
// @match https://www.medium.com/* | |
// @match https://stackoverflow.com/* | |
// @match https://www.reddit.com/* | |
// @match https://*.youtube.com/* | |
// @match https://www.quora.com/* | |
// @match https://www.reuters.com/* | |
// @match https://www.tumblr.com/* | |
// @match https://twitter.com/* | |
// @match https://www.urbandictionary.com/* | |
// @match https://x.com/* | |
// @run-at document_start | |
// @allFrames false | |
// @noframes | |
// ==/UserScript== | |
function getRedirect() { | |
const instances = { | |
ducksforducks: ['https://ducksforducks.private.coffee'], | |
nerdsfornerds: ['https://nn.vern.cc'], | |
invidious: [ | |
'https://inv.nadeko.net', | |
'https://invidious.nerdvpn.de', | |
'https://invidious.f5.si', | |
'https://yewtu.be', | |
'https://invidious.snopyta.org', | |
], | |
piped: [ | |
'https://watch.whatever.social', | |
'https://piped.garudalinux.org', | |
'https://piped.lunar.icu', | |
'https://piped.projectsegfau.lt', | |
'https://piped.privacydev.net', | |
'https://piped.smnz.de', | |
'https://piped.adminforge.de', | |
'https://piped.qdi.fi', | |
'https://piped.hostux.net', | |
'https://pd.vern.cc', | |
'https://piped.colinslegacy.com', | |
'https://piped.ducks.party', | |
'https://piped.video', | |
'https://efy.piped.pages.dev/', | |
'https://il.ax/', | |
'https://pa.il.ax/', | |
'https://piped.dedyn.io/', | |
'https://piped.drgns.space/', | |
'https://piped.kavin.rocks/', | |
'https://piped.mha.fi/', | |
'https://piped.minionflo.net/', | |
'https://piped.palveluntarjoaja.eu/', | |
'https://piped.private.coffee/', | |
'https://piped.reallyaweso.me/', | |
'https://piped.tokhmi.xyz/', | |
'https://piped.video/', | |
'https://pipedapi.palveluntarjoaja.eu/', | |
], | |
nitter: [ | |
'https://xcancel.com', | |
'https://nitter.poast.org', | |
'https://nitter.privacyredirect.com', | |
'https://lightbrd.com', | |
'https://nitter.space', | |
'https://nitter.tiekoetter.com', | |
'https://nuku.trabun.org', | |
'https://nitter.privacydev.net', | |
'https://nitter.net', | |
], | |
redlib: [ | |
'https://redlib.catsarch.com', | |
'https://redlib.perennialte.ch', | |
'https://redlib.tux.pizza', | |
'https://redlib.ducks.party', | |
'https://r.darrennathanael.com', | |
'https://redlib.privacyredirect.com', | |
'https://reddit.nerdvpn.de', | |
'https://redlib.baczek.me', | |
'https://reddit.adminforge.de', | |
'https://rl.blitzw.in', | |
'https://redlib.orangenet.cc', | |
'https://redlib.privadency.com', | |
'https://redlib.minihoot.site', | |
'https://l.opnxng.com', | |
'https://red.arancia.click', | |
'https://red.artemislena.eu', | |
'https://red.ngn.tf', | |
'https://redlib.kittywi.re', | |
'https://redlib.nadeko.net', | |
'https://redlib.privacy.com.de', | |
'https://rl.bloat.cat', | |
'https://rl.rootdo.com', | |
'https://safereddit.com', | |
'https://redlib.freedit.eu', | |
], | |
scribe: [ | |
'https://scribe.rip', | |
'https://scribe.nixnet.services', | |
'https://scribe.citizen4.eu', | |
'https://scribe.bus-hit.me', | |
'https://scribe.froth.zone', | |
'https://scribe.privacydev.net', | |
'https://scribe.rawbit.ninja', | |
'https://sc.vern.cc', | |
'https://m.opnxng.com', | |
'https://scribe.manasiwibi.com', | |
'https://scribe.r4fo.com', | |
'https://scribe.privacyredirect.com', | |
'https://scribe.privacyredirect.com/', | |
'https://scribe.rawbit.ninja/', | |
'https://scribe.rip/', | |
], | |
small: ['https://small.private.coffee'], | |
quetre: [ | |
'https://quetre.iket.me', | |
'https://qr.vern.cc', | |
'https://quetre.pussthecat.org', | |
'https://quetre.tokhmi.xyz', | |
'https://quetre.privacydev.net', | |
'https://ask.habedieeh.re', | |
'https://quetre.blackdrgn.nl', | |
'https://quetre.lunar.icu', | |
'https://q.opnxng.com', | |
'https://ask.sudovanilla.org', | |
'https://quetre.drgns.space', | |
'https://quetre.r4fo.com', | |
'https://quetre.ducks.party', | |
'https://quetre.nadeko.net', | |
'https://quetre.private.coffee', | |
'https://quetre.canine.tools', | |
'https://qt.bloat.cat', | |
'https://quetre.jeikobu.net', | |
'https://quetre.franklyflawless.org', | |
'https://q.307200.xyz', | |
'https://quora.nerdvpn.de', | |
'https://quetre.privacyredirect.com', | |
'https://quora.vern.cc', | |
'https://quetre.projectsegfau.lt', | |
'https://quetre.esmailelbob.xyz', | |
'https://quetre.marcopisco.com', | |
'https://quetre.pufe.org', | |
'https://que.wilbvr.me', | |
'https://questions.whateveritworks.org', | |
'https://quetre.catsarch.com', | |
'https://quetre.frontendfriendly.xyz', | |
'https://quetre.odyssey346.dev/', | |
'https://quetre.pussthecat.org/', | |
], | |
breezewiki: [ | |
'https://breezewiki.com', | |
'https://antifandom.com', | |
'https://breezewiki.pussthecat.org', | |
'https://bw.hamstro.dev', | |
'https://bw.projectsegfau.lt', | |
'https://breeze.hostux.net', | |
'https://bw.artemislena.eu', | |
'https://nerd.whatever.social', | |
'https://breezewiki.frontendfriendly.xyz', | |
'https://breeze.nohost.network', | |
'https://breeze.whateveritworks.org', | |
'https://z.opnxng.com', | |
'https://breezewiki.hyperreal.coffee', | |
'https://breezewiki.catsarch.com', | |
'https://breeze.mint.lgbt', | |
'https://breezewiki.woodland.cafe', | |
'https://breezewiki.nadeko.net', | |
'https://fandom.reallyaweso.me', | |
'https://breezewiki.4o1x5.dev', | |
'https://breezewiki.r4fo.com', | |
'https://breezewiki.private.coffee', | |
'https://fan.blitzw.in', | |
'https://antifandom.com/', | |
'https://breezewiki.com/', | |
'https://breezewiki.nadeko.net/', | |
'https://breezewiki.pussthecat.org/', | |
'https://bw.hamstro.dev/', | |
'https://bw.projectsegfau.lt/', | |
'https://z.opnxng.com/', | |
], | |
neuters: ['https://neuters.de', 'https://nu.vern.cc'], | |
ruraldictionary: [ | |
'https://rd.vern.cc', | |
'https://rd.bloat.cat', | |
'https://rd.thirtysix.pw', | |
'https://rd.cmc.pub', | |
'https://ruraldictionary.franklyflawless.org', | |
], | |
libmedium: [ | |
'https://libmedium.batsense.net', | |
'https://md.vern.cc', | |
'https://medium.hostux.net', | |
'https://r.sudovanilla.org', | |
'https://libmedium.ducks.party', | |
'https://libmedium.batsense.net/', | |
'https://libmedium.ducks.party/', | |
], | |
dumb: [ | |
'https://dm.vern.cc', | |
'https://sing.whatever.social', | |
'https://dumb.lunar.icu', | |
'https://dumb.privacydev.net', | |
'https://dumb.ducks.party', | |
'https://dumb.privacyfucking.rocks', | |
'https://dumb.hyperreal.coffee', | |
'https://dumb.bloat.cat', | |
'https://dumb.jeikobu.net', | |
'https://dumb.canine.tools', | |
'https://lyr.dc09.ru', | |
'https://db.kuuro.net', | |
'https://dumb.nunosempere.com', | |
'https://dumb.esmailelbob.xyz', | |
'https://dumb.ducks.party/', | |
'https://dumb.lunar.icu/', | |
], | |
anonymousoverflow: [ | |
'https://code.whatever.social', | |
'https://ao.vern.cc', | |
'https://overflow.smnz.de', | |
'https://overflow.lunar.icu', | |
'https://overflow.adminforge.de', | |
'https://overflow.hostux.net', | |
'https://overflow.projectsegfau.lt', | |
'https://code.xbdm.fun', | |
'https://overflow.fascinated.cc', | |
'https://ao.bloat.cat', | |
'https://anonoverflow.frontendfriendly.xyz', | |
'https://ao.owo.si', | |
'https://overflow.datura.network', | |
'https://overflow.freedit.eu', | |
'https://ao.rootdo.com', | |
'https://anonoverflow.hyperreal.coffee', | |
'https://o.sudovanilla.org', | |
'https://anonymousoverflow.privacyfucking.rocks', | |
'https://exchange.seitan-ayoub.lol', | |
'https://overflow.r4fo.com', | |
'https://overflow.ducks.party', | |
'https://ao.ngn.tf', | |
'https://overflow.snine.nl', | |
'https://anonymousoverflow.privacyredirect.com', | |
'https://soflow.nerdvpn.de', | |
'https://overflow.einfachzocken.eu', | |
'https://overflow.seasi.dev', | |
'https://anonymousoverflow.catsarch.com', | |
'https://overflow.darkness.services', | |
'https://anonflow.aketawi.space', | |
'https://ao.bunk.lol', | |
'https://o.iii.st', | |
'https://overflow.canine.tools', | |
'https://ao.bloatcat.tk', | |
'https://ao.bloat.cat/', | |
'https://ao.ngn.tf/', | |
], | |
priviblur: [ | |
'https://pb.bloat.cat', | |
'https://tb.opnxng.com', | |
'https://priviblur.pussthecat.org', | |
'https://priviblur.thebunny.zone', | |
'https://priviblur.canine.tools', | |
'https://pb.cleberg.net', | |
'https://tumblr.nerdvpn.de', | |
], | |
eddrit: ['https://eddrit.com/'], | |
intellectual: [ | |
'https://in.bloat.cat/', | |
'https://intellectual.catsarch.com/', | |
'https://intellectual.insprill.net/', | |
], | |
'photon-reddit': ['https://photon-reddit.com/'], | |
}; | |
const replacements = Object.entries({ | |
fandom: ['breezewiki'], | |
geeksforgeeks: ['ducksforducks', 'nerdsfornerds'], | |
genius: ['dumb', 'intellectual'], | |
medium: ['libmedium', 'scribe', 'small'], | |
quora: ['quetre'], | |
reddit: ['eddrit', 'photon-reddit', 'redlib'], | |
reuters: ['neuters'], | |
stackoverflow: ['anonymousoverflow'], | |
tumblr: ['priviblur'], | |
twitter: ['nitter'], | |
urbandictionary: ['ruraldictionary'], | |
'x.com': ['nitter'], | |
youtube: ['invidious', 'piped'], | |
}); | |
const replacement = replacements.find(([host]) => | |
location.hostname.includes(host), | |
); | |
if (replacement) { | |
const chooseRandom = (list) => | |
list.at(Math.floor(Math.random() * list.length)); | |
const [, options] = replacement; | |
const type = chooseRandom(options); | |
const instancesForType = instances[type]; | |
if (instancesForType?.length > 0) { | |
const instance = chooseRandom(instancesForType); | |
const redirect = new URL(location.pathname, instance); | |
return redirect; | |
} | |
} | |
const redirect = new URL('https://farside.link'); | |
redirect.pathname = `/_/${location.href}`; | |
return redirect; | |
} | |
function main() { | |
const redirect = getRedirect(); | |
location.replace(redirect); | |
} | |
main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment