twitpic.dms

提供: Yourpedia
2011年10月24日 (月) 09:38時点におけるAbcdefgh (トーク | 投稿記録)による版

移動: 案内検索

Irvineを使ってTwitpicの画像を落とすためのスクリプト。サムネイル画像が表示されるページや、URLが貼られたTwitterのページから「IrvineへすべてのURLを送る」で使う。FULL SIZE画像を落とせるように改良。

  1. [ttp://mxmkitchen.com/2009/03/13/2357.php ここ]からIrvineとDorothy2.zipをDL、インストールする
  2. 「(Irvineが有るフォルダ)¥Dorothy2¥program¥」に「twitpic.dms」を以下の内容で作成する
  3. Irvineを起動後、上記サイトに出てる設定を行う
    1. 「ツール」→「メインメニュー」→「動画ダウンロード2設定」で「twitpic」にチェックを入れて、「ファイル」→「保存して終了」をクリック、それ以外は同様
  4. 後は、ほぼ上記サイトの説明通り
//Dorothy2
//caption=twitpic
//version=0.01
//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
//ファイル名の単純変換が不可能な為

function(){
	println('twitpic.dms start');
	// 画像紹介ページURLをFULL SIZEページの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\/[^"]+)\"/)) {
		println('error---> オリジナルサイズの画像が見つかりません');
		exit();
	}
	var title='http:' + 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;
}