Skip to content

Instantly share code, notes, and snippets.

@pooza
Last active December 7, 2021 07:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pooza/ef89690dc534b2516e5d9c9d936ef886 to your computer and use it in GitHub Desktop.
Save pooza/ef89690dc534b2516e5d9c9d936ef886 to your computer and use it in GitHub Desktop.

twitter.comはノイズが多すぎる件

Twitterのアカウントを持たない者にとって、twitter.comのページはノイズが多すぎて利用しづらいのです。

機能

  • twitter.com宛てのリンクをnitter.net宛てに書き替えます。
  • 2秒ごとに実行されます。

動作環境

ユーザースクリプトですので、それを利用できる拡張機能を入れてください。

インストール

変更履歴

1.0.2

  • mobile.twitter.com への対応。

1.0.1

  • 10秒後から2秒ごとに変更。

1.0.0

  • 初回バージョン
// ==UserScript==
// @name twitter.comはノイズが多すぎる件
// @namespace http://tampermonkey.net/
// @version 1.0.2
// @description twitter.com宛てのリンクを、全てnitter.net宛てに書き替えます。
// @author Tatsuya Koishi https://mstdn.b-shock.org/@pooza
// @match https://precure.ml/*
// @match https://mstdn.delmulin.com/*
// @match https://mstdn.b-shock.org/*
// @grant none
// ==/UserScript==
(function() {
'use strict'
window.addEventListener('load', () => {
setInterval(() => {
for (let link of document.getElementsByTagName('a')) {
let href = link.getAttribute('href')
if (href.match(/twitter\.com/)) {
link.setAttribute('href', href.replace(/(mobile\.)?twitter\.com/, 'nitter.net'))
}
}
}, 2000)
})
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment