Last active
November 30, 2019 09:04
-
-
Save roodni/c68905c2f69a5b8b91fd556c5266c435 to your computer and use it in GitHub Desktop.
TweetDeckで特定のアカウントををほぼ完全に自分の視界から遮断する
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
// actionsMenuが存在するツイートに対し、ツイート元を判別してなにかしらできる | |
// (引用RT内にはactionsMenuが存在しないのでダメ) | |
// TweetDeckのバージョン:Version 4.0.190522185232-ff29ba1 (web) | |
// Chrome拡張のScriptAutoRunnerとかで実行するといいと思います(適当) | |
(()=>{ | |
const tweet_sel = '.js-stream-item'; | |
const replaced_class = 'replaced'; | |
const css = document.styleSheets[0]; | |
css.insertRule(tweet_sel + '{ visibility: hidden; }'); | |
// ミュートするid(これは私のid) | |
const mute_ids = new Set(['775322601656680448']); | |
const loop = () => { | |
const tweets = document.querySelectorAll(tweet_sel + `:not(.${replaced_class})`); | |
for (let tweet of tweets) { | |
tweet.classList.add(replaced_class); | |
const actionsMenu = tweet.querySelector('a[rel="actionsMenu"]'); | |
if (actionsMenu !== null) { | |
// ユーザ名 | |
const tweet_user_id = actionsMenu.getAttribute('data-user-id'); | |
// 強化ミュート | |
if (!mute_ids.has(tweet_user_id)) { | |
tweet.style.visibility = 'visible'; | |
} | |
} else { | |
tweet.style.visibility = 'visible'; | |
} | |
} | |
} | |
setInterval(loop, 500); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment