#10802
okita
参加者

関連キーワードがない日は文章が消えていました。
やり直し。

editor.newFile();
OutputBar.clear();
OutputBar.Visible = true;
OutputBar.writeln(“日経新聞データ取得中…”);
Redraw = false;
var http = new ActiveXObject(“Microsoft.XMLHTTP”);
http.open(“GET”, “http://www.nikkei.com/news/editorial/”, false);
http.onreadystatechange = function() {
if (http.readyState != 4) return;
document.write(http.responseText);
}
http.send(null);
document.selection.StartOfDocument();
//検索オプション
nFlags = eeFindNext|eeFindReplaceQuiet;
//社説を探す
if (document.selection.Find(“

社説

“, nFlags)) {
document.selection.CharRight();
//最初に見つかったリンクをGET
if (document.selection.Find(“<a href="",nFlags)) {
xPos = document.selection.GetActivePointX(eePosLogicalA);
yPos = document.selection.GetActivePointY(eePosLogical);
if (document.selection.Find("" class=",nFlags)) {
document.selection.CharLeft();
xEnd = document.selection.GetActivePointX(eePosLogicalA);
yEnd = document.selection.GetActivePointY(eePosLogical);
document.selection.SetActivePoint(eePosLogicalA,xPos,yPos);
document.selection.SetAnchorPoint(eePosLogicalA,xPos,yPos);
document.selection.SetActivePoint(eePosLogicalA,xEnd,yEnd,true);
//社説へのリンクを保存
var strSyasetu = document.selection.Text;
//春秋を探す
document.selection.StartOfDocument();
document.selection.Find("

春秋

“, nFlags);
document.selection.CharRight();
document.selection.Find(“<a href="",nFlags);
xPos = document.selection.GetActivePointX(eePosLogicalA);
yPos = document.selection.GetActivePointY(eePosLogical);
document.selection.Find("" class=",nFlags);
document.selection.CharLeft();
xEnd = document.selection.GetActivePointX(eePosLogicalA);
yEnd = document.selection.GetActivePointY(eePosLogical);
document.selection.SetActivePoint(eePosLogicalA,xPos,yPos);
document.selection.SetAnchorPoint(eePosLogicalA,xPos,yPos);
document.selection.SetActivePoint(eePosLogicalA,xEnd,yEnd,true);
var strSyunju = document.selection.Text;
OutputBar.writeln("社説データ取得中…");
http.open("GET", "http://www.nikkei.com&quot; + strSyasetu, false);
var xSyunju;
var ySyunju;
http.onreadystatechange = function() {
if (http.readyState != 4) return;
document.selection.SelectAll();
document.selection.Delete();
document.write(http.responseText);
Trim_Data(1,1);
document.selection.EndOfDocument();
xSyunju = document.selection.GetActivePointX(eePosLogicalA);
ySyunju = document.selection.GetActivePointY(eePosLogical);
}
}
}
}

//春秋をGET
http.send(null);
OutputBar.writeln("春秋データ取得中…");
http.open("GET", "http://www.nikkei.com&quot; + strSyunju, false);
http.onreadystatechange = function() {
if (http.readyState != 4) return;
document.write(http.responseText);
Trim_Data(xSyunju,ySyunju);
}
http.send(null);
OutputBar.Visible = false;
document.selection.StartOfDocument();
Redraw=true;

//トリミング
function Trim_Data(xStart,yStart) {
var nFlags = eeFindNext|eeFindReplaceQuiet;
document.selection.StartOfDocument();
document.selection.SetActivePoint(eePosLogicalA,xStart,yStart);
document.selection.Find("

“,nFlags);
document.selection.CharRight();
var xEnd = document.selection.GetActivePointX(eePosLogicalA);
var yEnd = document.selection.GetActivePointY(eePosLogical);
document.selection.SetActivePoint(eePosLogicalA,xStart,yStart);
document.selection.SetAnchorPoint(eePosLogicalA,xStart,yStart);
document.selection.SetActivePoint(eePosLogicalA,xEnd,yEnd,true);
document.selection.CharRight(true);
document.selection.Delete();
document.selection.Find(“

【PR】

“,nFlags);
document.selection.CharLeft();
var xPos = document.selection.GetActivePointX(eePosLogicalA);
var yPos = document.selection.GetActivePointY(eePosLogical);
document.selection.SetActivePoint(eePosLogicalA,xPos,yPos);
document.selection.SetAnchorPoint(eePosLogicalA,xPos,yPos);
document.selection.EndOfDocument(true);
document.selection.Delete();
document.selection.SetActivePoint(eePosLogicalA,xStart,yStart);
document.selection.SetAnchorPoint(eePosLogicalA,xStart,yStart);
document.selection.EndOfDocument(true);
document.selection.CharRight(true);
document.selection.Replace(“>”,”>”,eeReplaceAll|eeReplaceSelOnly);
document.selection.Replace(” “,””,eeReplaceAll|eeReplaceSelOnly);
document.selection.Replace(“|]*>”,””,eeFindReplaceRegExp|eeReplaceAll|eeReplaceSelOnly);
document.selection.Replace(“_nk.formevent(.*?);”,””,eeFindReplaceRegExp|eeReplaceAll|eeReplaceSelOnly);
document.selection.Replace(“_nk.fontsize(.*?);”,””,eeFindReplaceRegExp|eeReplaceAll|eeReplaceSelOnly);
document.selection.Replace(“_nkconf.?(.*?);”,””,eeFindReplaceRegExp|eeReplaceAll|eeReplaceSelOnly);
document.selection.Replace(“t”,””,eeFindReplaceEscSeq|eeReplaceAll|eeReplaceSelOnly);
document.selection.Replace(“^ ..*$”,””,eeFindReplaceRegExp|eeReplaceAll|eeReplaceSelOnly);
document.selection.Replace(“^n”,””,eeFindReplaceRegExp|eeReplaceAll|eeReplaceSelOnly);
document.selection.Replace(“^小サイズに変更.*?印刷$”,””,eeFindReplaceRegExp|eeReplaceAll|eeReplaceSelOnly);
}