Last active
October 24, 2023 20:08
-
-
Save Thunraz/b192d65d58c6eb93c762016f21c48f87 to your computer and use it in GitHub Desktop.
Twitter to Nitter
This file contains 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 Twitter to Nitter | |
// @namespace http://tampermonkey.net/ | |
// @version 0.2 | |
// @description Redirects Twitter to a Nitter instance | |
// @author Thunraz <thunraz@thunraz.com> | |
// @match https://twitter.com/* | |
// @match https://x.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=twitter.com | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const nitterInstance = 'https://nitter.d420.de/'; | |
const pattern = /https:\/\/(?:(?:twitter.com)|(?:x.com))\/(.*)/; | |
const queryString = document.location.href.match(pattern)[1]; | |
document.location.href = nitterInstance + queryString; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment