twitpic.dms
提供: Yourpedia
Irvineを使ってTwitpicの画像を落とすためのスクリプト。サムネイル画像が表示されるページや、URLが貼られたTwitterのページから「IrvineへすべてのURLを送る」で使う。FULL SIZE画像を落とせるように改良。本スクリプトは「t-co.dms」からの呼び出しにも使われる。2012年11月28日以降にFULL SIZE画像を落とせない様になった仕様変更にも対応。
- ここからIrvineとDorothy2.zipをDL、インストールする
- 「(Irvineが有るフォルダ)¥Dorothy2¥program¥」に「twitpic.dms」を以下の内容で作成する
- Irvineを起動後、上記サイトに出てる設定を行う
- 「ツール」→「メインメニュー」→「動画ダウンロード2設定」で「twitpic」にチェックを入れて、「ファイル」→「保存して終了」をクリック、それ以外は同様
- 後は、ほぼ上記サイトの説明通り
//Dorothy2
//caption=twitpic
//version=0.02
//hint=twitterのページ・twitpicのサムネイルページからURLを渡してください
//match=http://(www.)?twitpic.com/
//author=Abcdefgh
//path=program
//priority=500
//end
//created 22,Jan.,2011 by Abcdefgh
//modified 17,May.,2011 by Abcdefgh
//modified 07,Jan.,2012 by Abcdefgh
//modified 09,Nov.,2012 by Abcdefgh
//ファイル名の単純変換が不可能な為
//t-co.dmsから呼び出される
function(){
println('twitpic.dms start');
// 画像紹介ページURLをFULL SIZEページのURLに変換
headers.Referer = urlinfo.url;
var url = new URL(urlinfo.url + '/full');
urlinfo.url = url.url;
headers.host = url.host;
// FULL SIZEページをダウンロード
common_load('download');
var http = download(urlinfo.url);
if(http.responseHeader.code != 200){
return retry('error--->' + http.responseHeader.code);
}
// 本画像URLを抽出
if (!http.data.match(/src=\"([^"]+(full|large|scaled)[^"]*[.](jpg|png|gif)[^"]*)\"/)) {
println('error---> オリジナルサイズの画像が見つかりません');
exit();
}
var title=RegExp.$1;
headers.Referer = urlinfo.url;
var url = new URL(title);
urlinfo.url = url.url;
headers.host = url.host;
//ファイル名を抽出
if (!title.match(/([^\/?]+)([?].+)?$/)) {
println('error---> ファイル名が見つかりません');
exit();
}
Dorothy.fileName = RegExp.$1;
}