Irvine Part25

このエントリーをはてなブックマークに追加
401名無し~3.EXE
手抜きだけど作ってみた
//match=http://board.sweetnote.com/[^\/]+/(image/\d+$|thread/\d+/$)
function(){
common_load('download', 'fileSave', 'dummy_url', 'character_references');
var http = download(urlinfo.url);
if( http.responseHeader.code != 200 ){ println('error ----> ' + http.responseHeader.code); exit(); }
if( urlinfo.url.match(/\/thread\//) ){
var urlList = [];
http.data.replace(/<div class="comment-body">\s*<div class="image" id="[^"]*">\s*<p><a href="([^"]+)"/g,
function( s0, s1 ){ urlList.add( (new URL(urlinfo.url)).expand(s1) ); }
);
fileSave('url list.txt', urlList.join("\n"));
dummy_url();
Dorothy.fileName = 'remove';
return;
}
var threadTitle = http.data.match(/<span class="name"><a href="\/[^\/]+\/thread\/\d+\/">([^<>]+?) \(\d+\)</) ? character_references(RegExp.$1.fromUTF8toSJIS().trim()) : '?';
var resNumber = http.data.match(/<p class="comment-header">\s*<span class="resno">\s*<a href="\/[^\/]+\/thread\/\d+\/(\d+)" rel="nofollow">/) ? RegExp.$1 : '0';
var url = http.data.match(/<img style="[^"]*" id="fullimage" src="([^"]+)"/) ? (new URL(urlinfo.url)).expand(RegExp.$1) : null;
if( url == null ){ println('error ----> url not found'); exit(); }
urlinfo.url = (new URL(url)).url;
headers['Referer'] = urlinfo.url;
Dorothy.fileName = changeFileName(threadTitle + ' - ' + resNumber + File.extractExt((new URL(url)).filename));
}