Skip to content

Instantly share code, notes, and snippets.

@ryonakae
Last active October 14, 2025 15:11
Show Gist options
  • Select an option

  • Save ryonakae/5af02f45e50be8e4e90e137132784492 to your computer and use it in GitHub Desktop.

Select an option

Save ryonakae/5af02f45e50be8e4e90e137132784492 to your computer and use it in GitHub Desktop.
Twitterの興味関心 (https://twitter.com/settings/your_twitter_data/twitter_interests) のチェックをすべて外すブックマークレット
javascript:(function(){var b=[],c=0,d=0;document.querySelector("main").querySelectorAll('input[type="checkbox"][checked]').forEach(function(a){b.push(a)});window.addEventListener("error",function(a){clearInterval(c);alert("\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u305f\u3081\u4e2d\u65ad\u3057\u307e\u3057\u305f")});c=setInterval(function(){var a=b[d],e=a.closest("label");a=a.getBoundingClientRect().top+window.scrollY+100;window.scrollTo(0,a);e.dispatchEvent(new MouseEvent("click"));d++;d===b.length&&
(clearInterval(c),alert("\u3059\u3079\u3066\u306e\u30c1\u30a7\u30c3\u30af\u3092\u5916\u3057\u307e\u3057\u305f"))},100)})();
function () {
var inputArray = [];
var timer = 0;
var count = 0;
document
.querySelector("main")
.querySelectorAll('input[type="checkbox"][checked]')
.forEach(function (input) {
inputArray.push(input);
});
window.addEventListener("error", function (error) {
clearInterval(timer);
alert("エラーが発生したため中断しました");
});
timer = setInterval(function () {
var input = inputArray[count];
var label = input.closest("label");
var offsetTop = input.getBoundingClientRect().top + window.scrollY + 100;
window.scrollTo(0, offsetTop);
label.dispatchEvent(new MouseEvent("click"));
count++;
if (count === inputArray.length) {
clearInterval(timer);
alert("すべてのチェックを外しました");
}
}, 100);
}
@ryonakae
Copy link
Author

setIntervalの間隔を100msから1000msに変更

@ryonakae
Copy link
Author

ブックマークレット変換サービス: http://websitetools.biz-box.jp/js_bookmarklet.php

@ryonakae
Copy link
Author

興味関心ページ以外のURLでブックマークレットを実行した場合、興味関心ページにリダイレクトするようにアップデート

@ryonakae
Copy link
Author

チェックする間隔が1秒でもすぐAPI制限がかかるので、3秒にアップデート

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment