// ==UserScript== // @name HatebuPercentage // @namespace http://www.kmonos.net/ // @author k.inaba // @include http://b.hatena.ne.jp/* // @description Modify the link text to a 'Hatena-Bookmark' entry page and show how many of the users have left comments on the entry // ==/UserScript== // Released under the NYSL license // http://www.kmonos.net/nysl/ (function () { function addInfo(a) { var url = a.getAttribute("href").split('\/entry\/')[1]; url = 'http://b.hatena.ne.jp/entry/json/?url=' + encodeURIComponent(url) + '&callback=hbPercent'; GM_xmlhttpRequest({ method: "GET", url: url, onload: function(details) { var parts = eval(details.responseText); if(parts[0]!='undefined'){ a.innerHTML += parts[0]; a.parentNode.parentNode.innerHTML += parts[1]; } } }) /* url = 'http://b.hatena.ne.jp/' + url; GM_xmlhttpRequest({ method: "GET", url: url, onload: function(details) { var withComment = 0; var d = details.responseText; while (m = d.match(/