「instagra.dms」の版間の差分

提供: Yourpedia
移動: 案内検索
(matchを変更)
(リサイズ前サイズ画像dlに対応)
10行目: 10行目:
 
//Dorothy2
 
//Dorothy2
 
//caption=Instagram
 
//caption=Instagram
//version=0.02
+
//version=0.03
 
//hint=Twitter・TwilogのページからURLを渡してください
 
//hint=Twitter・TwilogのページからURLを渡してください
 
//match=https?://(www[.])?(i[.])?[Ii]nstagr[.]?am
 
//match=https?://(www[.])?(i[.])?[Ii]nstagr[.]?am
19行目: 19行目:
 
//created 14,Dec.,2011 by Abcdefgh
 
//created 14,Dec.,2011 by Abcdefgh
 
//modified 27,Apr.,2014 by Abcdefgh
 
//modified 27,Apr.,2014 by Abcdefgh
//ファイル名の単純変換が不可能な為
+
//modified 7,Apr.,2017 by Abcdefgh
 +
//リサイズ前サイズ画像dlに対応
  
 
function(){
 
function(){
40行目: 41行目:
 
}
 
}
 
var title = RegExp.$1;
 
var title = RegExp.$1;
 +
 +
var title2 = title.match(/^https?:\/\/[^\/]+\//)[0];
 +
var title3 = title.match(/\/[^\/]+$/)[0];
 +
var title = title2 + title3;
  
 
var url = new URL(title);
 
var url = new URL(title);

2017年4月7日 (金) 07:29時点における版

Irvineを使ってインスタグラムの静止画を落とすためのスクリプト。TwitterTwilogのページから「IrvineへすべてのURLを送る」で使う。本スクリプトは「t-co.dms」からの呼び出しにも使われる。

  1. ここからIrvineとDorothy2.zipをDL、インストールする
  2. 「(Irvineが有るフォルダ)¥Dorothy2¥program¥」に「Instagra.dms」を以下の内容で作成する
  3. Irvineを起動後、上記サイトに出てる設定を行う
    1. 「ツール」→「メインメニュー」→「動画ダウンロード2設定」で「Instagram」にチェックを入れて、「ファイル」→「保存して終了」をクリック、それ以外は同様
    2. 呼び出し元の「t-co.dms」も上記同様に用意しておく
  4. 後は、ほぼ上記サイトの説明通り
//Dorothy2
//caption=Instagram
//version=0.03
//hint=Twitter・TwilogのページからURLを渡してください
//match=https?://(www[.])?(i[.])?[Ii]nstagr[.]?am
//author=Abcdefgh
//path=program
//priority=500
//end
//created 14,Dec.,2011 by Abcdefgh
//modified 27,Apr.,2014 by Abcdefgh
//modified 7,Apr.,2017 by Abcdefgh
//リサイズ前サイズ画像dlに対応

function(){
	println('instagra.dms start');
	// 画像紹介ページをダウンロード
	var title = urlinfo.url;
	title = title.replace(/http:/,"https:");
	var url = new URL(title);
	urlinfo.url = url.url;
	headers.host = url.host;
	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(/og:image\" content=\"([^"]+)\"/)) {
		println('error---> オリジナルサイズの画像が見つかりません');
		exit();
	}
	var title = RegExp.$1;

	var title2 = title.match(/^https?:\/\/[^\/]+\//)[0];
	var title3 = title.match(/\/[^\/]+$/)[0];
	var title = title2 + title3;

	var url = new URL(title);
	urlinfo.url = url.url;
	headers.host = url.host;
	//ファイル名を抽出
	if (!title.match(/([^\/]+)$/)) {
		println('error---> ファイル名が見つかりません');
		exit();
	}
	Dorothy.fileName = RegExp.$1;
}