tou-ch.dms

提供: Yourpedia
2019年2月7日 (木) 23:55時点における由亜辺出夫 (トーク | 投稿記録)による版 (Mario Yonezawa (トーク) による版 363315 を取り消し)

(差分) ←前の版 | 最新版 (差分) | 次の版→ (差分)
移動: 案内検索

Irvineを使ってロケタッチ(写真つきタッチ)の静止画を落とすためのスクリプト。TwitterTwilogのページから「IrvineへすべてのURLを送る」で使う。本スクリプトは「t-co.dms」からの呼び出しにも使われる。

  1. ここからIrvineとDorothy2.zipをDL、インストールする
  2. 「(Irvineが有るフォルダ)¥Dorothy2¥program¥」に「tou-ch.dms」を以下の内容で作成する
  3. Irvineを起動後、上記サイトに出てる設定を行う
    1. 「ツール」→「メインメニュー」→「動画ダウンロード2設定」で「tou.ch」にチェックを入れて、「ファイル」→「保存して終了」をクリック、それ以外は同様
    2. 呼び出し元の「t-co.dms」も上記同様に用意しておく
  4. 後は、ほぼ上記サイトの説明通り
//Dorothy2
//caption=tou.ch
//version=0.01
//hint=tou.chのサムネイルページからURLを渡してください
//match=http://tou.ch/
//author=Abcdefgh
//path=program
//priority=500
//end
//created 18,Mar.,2013 by Abcdefgh
//ファイル名の単純変換が不可能な為

function(){
	println('tou-ch.dms start');
	// 画像紹介ページをダウンロード
	common_load('download');
	var http = download(urlinfo.url,true);
	if(http.responseHeader.code != 200){
		return retry('error--->' + http.responseHeader.code);
	}
	// 本画像URLを抽出
	if (!http.data.match(/content=\"(http:\/\/api.loctouch.com\/stf\/picture\/[^"]+)\"/)) {
		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;
}