アットウィキロゴ

i88+0

function myFunction() {
 
  uu="http://www.rino-m.jp/er06.html"
 
      str="";
      try {
 
 var response = UrlFetchApp.fetch(uu);
 str=response.getContentText("SJIS");
 
    } 
    catch (e) {}
 
 
  p1=str.indexOf("<tbody>");
  p2=str.indexOf("</tbody>",p1);
 
  str=str.substring(p1,p2);
 
 
  p1=str.indexOf("本文");
  p1=str.indexOf("<",p1);
  p2=str.indexOf("<tbody>",p1);
 
  delta=str.substring(0,p1);
 
  delta=play(delta);
 
 
  pon=str.substring(p1,p2);
 
  pon=play(pon);
 
   Logger.log(pon);
 
  str=play(str);
 
 
 
 
  var doc = DocumentApp.create(delta);
  var p1 = doc.appendParagraph(str);
  p1.setFontSize(18);
 
  doc.saveAndClose();
 
 
}
function play(str){
 
  sp=str;
  for(kk=1;kk<1000;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月12日 22:35