アットウィキロゴ

doushjki

var t=new Array();
var a=new Array();
var sp=new Array();
 
function myFunction() {
 
  urlx="http://nichi-pro.filmcity.jp/24th.htm";
 str="";
      try {
 
 var response = UrlFetchApp.fetch(urlx);
 str=response.getContentText("SJIS");
 
    } 
    catch (e) {}
 
 
 
  p1=str.indexOf("個人賞</b></font></TD>");
  p2=str.indexOf("</TABLE>",p1);
 
  str=str.substring(p1,p2);
 
 
  for(s=1;s<100;s++){
  str=str.replace("</TR>","</tr>");
  }
 
  var x=str.split("</tr>");
 
 for(s=0;s<x.length-1;s++){
 
   strx=x[s];
   for(sx=1;sx<100;sx++){
   strx=strx.replace("</TD>","</td>");
   }
 
 var x1=strx.split("</td>"); 
   t[s]="";
   a[s]="";
   sp[s]="ABC";
   for(sx=0;sx<x1.length;sx++){
   if(sx==0)t[s]=play(x1[sx]);
   if(sx==1)a[s]=play(x1[sx]);
   if(sx==2)sp[s]=x1[sx];
   }
 
 }
 
 number=x.length-2;
   Logger.log(number);
 
   id="1NNmVfwhRtHVG7HY_xCc3z4vRRxXTGX9wdJqZh3GrYEc";
 
ex = SpreadsheetApp.openById(id);
 
    sh = ex.getSheetByName("data");
 
for(s=1;s<number+1;s++){ 
sh.getRange(s,1).setValue(t[s]);
sh.getRange(s,2).setValue(a[s]);  
}
 
 
 
 
 
 }
 
 
function play(str){
 
  sp=str;
  for(kk=1;kk<10;kk++){
  sp=fresh(sp);
  }
  return sp;
}
 
function fresh(strstr){
 
  p1=strstr.indexOf("<")
  p2=-1; 
  if(p1>-1)p2=strstr.indexOf(">",p1)
  k="";
  if(p2>-1)k=strstr.substring(p1,p2)+">";
 
  strxp=strstr.replace(k,"");
 
  return strxp;
}  
 
最終更新:2017年04月14日 00:15