2020 06/01 20:38
    
    Category : ツール
    
[FOO-ADD-EXEC-DATA]
nextUserLoad = () => {
  const bcc = doc.body.classList;
  if(sectUser == null || !bcc.contains(`loop`)) return;
  const obj = sectUser.parentNode;
  userCnt++;
  if(obj != obj.parentNode.lastChild){
    obj.nextElementSibling.childNodes[0].click();
  } else {
    bcc.remove(`loop`);
    naviCmd(1);
  }
};
diaryDataLoad = () => {
  const pardes = sectUser.parentNode.childNodes;
  xhr("/cgi-bin/diary.cgi?oid=" + sectUser.id.substring(1) + ";c=0;n=1", null, e => {
    if(e.match(/全カテゴリ \((\d+)/)) pardes[19].textContent = RegExp.$1;
    if(e.match(/entry_date">([^<]+)/)){
      pardes[21].textContent = RegExp.$1;
      pardes[20].textContent = e.match(/class="C\d+"/g).length;
    }
    setTimeout(() => { bbsDataLoad(); }, 0);
  });
};
bbsDataLoad = () => {
  const pardes = sectUser.parentNode.childNodes;
  xhr("/cgi-bin/bbs.cgi?oid=" + sectUser.id.substring(1) + ";n=1", null, e => {
    if(e.match(/総件数: (\d+) 件/)) pardes[22].textContent = RegExp.$1;
    if(e.match(/no=(\d+);mode=edit/))pardes[23].textContent = RegExp.$1;
    if(e.match(/_time">([^<]+)/)) pardes[24].textContent = RegExp.$1;
    setTimeout(() => { profileDataLoad(); }, 0);
  });
};
profileDataLoad = () => {
  const pardes = sectUser.parentNode.childNodes;
  const user = sectUser.id.substring(1);
  if(" nancyan yadokari poem ".indexOf(" " + user + " ") != -1){
    if(user == "poem"){ pardes[25].textContent = 192; pardes[26].textContent = 217707; }
    if(user == "yadokari"){ pardes[25].textContent = 191; pardes[26].textContent = 50132; }
    if(user == "nancyan"){ pardes[25].textContent = 108; pardes[26].textContent = 14300; }
    setTimeout(() => { nextUserLoad(); }, 0);
  } else {
    xhr("/home/" + user + "/profile.html", null, e => {
      e = e.replace(/.+<tbody>|<\/tbody>.+/g, "");
      pardes[25].textContent = e.match(/<tr>/g).length;
      pardes[26].textContent = e.length;
      setTimeout(() => { nextUserLoad(); }, 0);
    });
  }
};
delayExec = dt => {
};
bcc = dt => {
};
/* -- 更新可能にする -- */
sxExecEntry = () => {
 
};
xhrDataLoad = user => {
  let file = ("main 50,menu 52,common 54,profile 56,footprint 58," +
    "diary 60,bbs 62,bbs_form 64,friends 66,links 68,main 4,menu 10").split(",");
  xhrDataLoop(user, file);
};
xmlLoad = () => {
  let file = ("main 70,menu 72,common 74,profile 76,footprint 78," +
    "diary 80,bbs 82,bbs_form 84,friends 86,links 88,main 4,menu 10").split(",");
  if(cellCmd.c1.classList.contains("tpE")) 
    cellCmd.c1.nextElementSibling.childNodes[1].click();
  else xmlLoop(file);
};
xmlDate = d => {
  d = new Date(d * 1000).toLocaleString("ja-JP");
  d = d.replace(/\d+:\d+:\d+/, "").
    replace(/\d\d(\d+\d)\/(\d+)/, "'$1 $2").replace(/ (\d\/)/, " 0$1").
    replace(/\/(\d )/, "/0$1");
  return d;
};
/* -- レコード内のfile分を取得してセルを書き換え -- */
xhrDataLoop = (user, file) => {
  let e = file.shift().split(" ");
  let n = e[1] - 0;
  if(n == 70) Fid("css1").click();
  if(n == 80) Fid("css2").click();
  if(n == 4) Fid("btnC7").click();
  let isHtml = [4,10].includes(n);
  let uri = `/home/${user}/${e[0]}.${isHtml ? "html" : "css"}`;
  echo("parInfo", uri.replace(/^.+\//, ""));
  xhr(uri, null, (s, d) => {
    let dt = Fid("M" + user).parentNode.childNodes;
    if(isHtml){
      dt[n + 3].textContent = xmlDate(d);
      dt[n + 2].textContent = String(s.match(/\x3cscript/gi).length - 1);
    } else {
      dt[n].textContent = xmlDate(d);
    }
    dt[n + 1].textContent = String(s.length).replace(/(\d+)(\d{3})$/, "$1,$2");
    if(file.length > 0) setTimeout(() => { xhrDataLoop(user, file) }, 700);
    else {
      let par = Fid("M" + user).parentNode;
      par.classList.remove("ws");
      par.classList.add("ws-on");
      if(xmlLoopSet){
        par = par.nextElementSibling;
        while(par){
          if(!par.classList.contains("tpE")) break;
          par = par.nextElementSibling;
        }
        if(par) par.firstChild.click();
        else {
          alert("最後まで終わりました");
        }
      }
    }
  });
};
xmlLoop = file => {
  let e = file.shift().split(" ");
  let user = echo("dtUser");
  let n = e[1] - 0;
  let isHtml = [4,10].includes(n);
  let uri = `/home/${user}/${e[0]}.${isHtml ? "html" : "css"}`;
  echo("parInfo", uri.replace(/^.+\//, ""));
  xhr(uri, null, (s, d) => {
    let o = Fcn("dtData", "e2");
    let a = Fid("M" + user).parentNode.childNodes;
 
    if(isHtml){
      o[n + 3].textContent = a[n + 3].textContent = xmlDate(d);
      o[n + 2].textContent = a[n + 2].textContent = 
        String(s.match(/\x3cscript/gi).length - 1);
    } else {
      o[n].textContent = a[n].textContent = xmlDate(d);
    }
    o[n + 1].textContent = a[n + 1].textContent =
      String(s.length).replace(/(\d+)(\d{3})$/, "$1,$2");
    if(file.length != 0 && file != []) setTimeout(() => { xmlLoop(file) }, 1000);
    else {
      if(xmlLoopSet){
        setTimeout(() => {
          cellCmd.c1.nextElementSibling.childNodes[1].click();
        }, 1000);
      }
    }
  });
};
[/FOO-ADD-EXEC-DATA]