Irvineを使ってpictamの静止画を落とすためのスクリプト。Twitter・Twilogのページから「IrvineへすべてのURLを送る」で使う。本スクリプトは「t-co.dms」からの呼び出しにも使われる。
//Dorothy2
//caption=pictam
//version=0.01
//hint=Twitter・TwilogのページからURLを渡してください
//match=http://pict.am/
//author=Abcdefgh
//path=program
//priority=500
//end
//created 14,Dec.,2011 by Abcdefgh
//ファイル名の単純変換が不可能な為
function(){
println('pictam.dms start');
// 画像紹介ページをダウンロード
common_load('download');
var http = download(urlinfo.url);
if(http.responseHeader.code != 200){
return retry('error--->' + http.responseHeader.code);
}
// 本画像URLを抽出
if (!http.data.match(/pic_box\"><img src=\"([^"]+)\"/)) {
println('error---> オリジナルサイズの画像が見つかりません');
exit();
}
var title = RegExp.$1;
var url = new URL(title);
urlinfo.url = url.url;
headers.host = url.host;
//ファイル名を抽出
if (!title.match(/([^\/]+)$/)) {
println('error---> ファイル名が見つかりません');
exit();
}
Dorothy.fileName = RegExp.$1;
}