アットウィキロゴ

mago

function myFunction() {
 
  for(tr=1;tr<101;tr++){
 
    m=tr+200;
 
    uu="http://saayaworld.x.fc2.com/shorts/ss"+m+".html"
 
  var response = UrlFetchApp.fetch(uu);
 str=response.getContentText('SJIS');
 
 
   id="1oYLuy3QNRqD-kqjBXNBGI-m0tJzArLHxZTHu6s0CBpI";
 
 var ex1 = SpreadsheetApp.openById(id);
 var sheet = ex1.getSheetByName("data");
 
 Logger.log(str)
 
 
 p1=str.indexOf("entry_body");
 p2=str.indexOf("<div",p1);;
 
  str=str.substring(p1,p2);
 
  for(s=1;s<100;s++){
  str=str.replace("<br />","△");
}
    for(s=1;s<200;s++){
  str=str.replace("\n","");
}
 
  str=str.replace("entry_body\">","");
 
 
 sheet.getRange(tr, 1).setValue(str);
 
  }
 
 
}
 
最終更新:2016年07月04日 23:10