Skip to content

Instantly share code, notes, and snippets.

@teramako
Created January 17, 2013 08:21
Show Gist options
  • Save teramako/4554515 to your computer and use it in GitHub Desktop.
Save teramako/4554515 to your computer and use it in GitHub Desktop.
はてなブックマークコメントでタイトルと同じ無意味なコメントを除去するスクリプト
// ==UserScript==
// @id hateb_rm_sameTitleComemnts
// @name hateb_rm_sameTitleComemnts.js
// @version 1.0
// @namespace teramako
// @author teramako
// @description
// @include http://b.hatena.ne.jp/entry/*
// @run-at document-end
// ==/UserScript==
function $id (id) {
return document.getElementById(id);
}
var title = $id("head-entry-link").title.trim();
var commentList = document.querySelectorAll(".bookmark-list > li > .comment");
for (var comment of commentList) {
if (comment.textContent.trim() === title) {
comment.parentNode.parentNode.removeChild(comment.parentNode);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment