標準新着日記からユーザ取得

[diary:172203]
[beforeExec]
dataNo = [];
userDat = " ";
entry = function(){
echo("infoDisp", "カテゴリ番号を取得中です");
Fx.e("/cgi-bin/diary.cgi?oid=all;n=0", "e1");
};
Lo.e1 = function(s){
s.replace(/oid=all;n=0;c=(\d+)/g, function(e0,e1){
dataNo.push(e1); return "";
});
echo("noDisp", "カテゴリ総数:" + dataNo.length + "件 カテゴリNo → " + dataNo.join(" ") + "\x3cbr />\x3cbr />" +
"\x3cbutton onclick='searchEntry()'>ユーザ取得\x3c/button>"
);
};
searchEntry = function(){
var no = dataNo.shift();
echo("infoDisp", "カテゴリ別ページを取得中です c=" + no + " : 残り" + dataNo.length);
Fx.e("/cgi-bin/diary.cgi?oid=all;n=200;c=" + no, "e2")
};
Lo.e2 = function(s){
s.replace(/\x3ca href="\/home\/([0-9a-z\-]+)\/"/g, function(e0,e1){
if(userDat.indexOf(" " + e1 + " ") == -1) userDat += e1 + " ";
return "";
});
echo("listDisp", "取得中です : " + userDat);
if(s.match(/cgi\-bin\/diary.cgi\?oid=all;n=\d+;c=\d+;s=\d+">\x3cspan title="より古い記事/)){
Fx.e(RegExp.$1, "e2");
} else {
if(dataNo.length != 0){
searchEntry();
} else {
echo("infoDisp", "全て終了しました。");
userDat = userDat.replace(/(^ | $)/g, "");
var o = userDat.split(" ");
o.sort();
echo("sortDisp", o.join(" "));
}
}
};

[/beforeExec]
[cssText]

[/cssText]
[body]
<$$a href="main.html?diary=172203">標準新着日記からユーザ取得
<$$br /><$$br>
<$$button onclick="entry()">1)カテゴリ番号の取得<$$/button>
<$$div id="noDisp"><$$/div>
<$$div id="infoDisp"><$$/div>
<$$div id="listDisp"><$$/div>
<$$div id="sortDisp"><$$div>
[/body]
[exec]
document.title = "標準新着日記からユーザ取得";
[/exec]
[/diary:172203]

■仕様書 2012 09/26 21:15 Wrote