// ==UserScript==
// @name lowreal.net
// @namespace http://lowreal.net/
// @include http://lowreal.net/*
// ==/UserScript==
(function () {
try {
var req =
bookmark.getCount
;
var nodes = document.getElementsByTagName("a");
var uris = {};
for (var i = 0; i < nodes.length; i++) {
if (nodes[i].href.match(RegExp(/\/logs\/\d\d\d\d\/\d\d\/\d\d\/\d$/))) {
uris[nodes[i].href] = nodes[i];
req..params.appendChild(
{nodes[i].href}
);
/*
GM_xmlhttpRequest({
method: "get",
url: "http://del.icio.us/url?url=" + nodes[i].href,
onload: function (res) {
var m = res.responseText.match(/This url has been saved by (\d+) people./);
if (m) {
var u = res.responseText.match(/del.icio.us history for ([^ ]+)<\/strong>/);
u = u[1];
alert(u);
var a = document.createElement("a");
a.href = "http://del.icio.us/url?url=" + u;
a.appendChild(document.createTextNode("[d:" + m[1] + "]"));
with (a.style) {
color = "#f00";
fontWeight = "bold";
}
uris[u].parentNode.appendChild(document.createTextNode(" "));
uris[u].parentNode.appendChild(a);
}
},
onerror: function (res) {
alert(res.status);
}
});
*/
}
}
GM_xmlhttpRequest({
method: "post",
url: "http://b.hatena.ne.jp/xmlrpc",
data: req.toString(),
onload: function (res) {
var response = new XML(res.responseText.replace(/^<\?xml.*?\?>/, ''));
for each (var member in response..member) {
if (Number(member..int) < 1) continue;
var a = document.createElement("a");
a.href = "http://b.hatena.ne.jp/entry/" + member.name;
a.appendChild(document.createTextNode("[h:" + member..int + "]"));
with (a.style) {
color = "#f00";
fontWeight = "bold";
}
uris[member.name].parentNode.appendChild(document.createTextNode(" "));
uris[member.name].parentNode.appendChild(a);
}
}
});
} catch (e) {
alert(e);
}
})();