å æ¥ãPVããã¤ã¼ããããµã¼ãã¹ã«ã³ã¡ã³ããå¤æ´åºæ¥ãWebAPIã追å ãã¾ããã
ããã§ç°¡åã«ã³ã¡ã³ãå¤æ´åºæ¥ãããã¨è¨ãããã¨ããã§ãããWebAPIå ¬éããã¦ããããã©ãå©ããã¨ããåé¡ãããã¨æãã¾ãã
ãã£ã¨ãããããªããå ¬éããã¦ããã©ããã£ãããããããããããï¼ãã£ã¦æã£ã¦ã人ãå°ãªãããããããããªããããã¨ã
ãããªäººã®ããã«ãç°¡åã«ã³ã¡ã³ããå¤æ´åºæ¥ãä»çµã¿ãç´¹ä»ãã¾ããã
Googleã¹ãã¬ããã·ã¼ãã使ãã
Googleã¹ãã¬ããã·ã¼ãã§ã¹ã¯ãªãããå®è¡ã§ãã¾ããã¾ããExcelã®ãã¯ãï¼VBAï¼ã¿ãããªããã§ããã
ãã®ã¹ã¯ãªããã§ãããã¹ã±ã¸ã¥ã¼ã«å®è¡ããæ©è½ããããã§ããããã¾ã§ã§å¤§ä½è¦å½ã¤ãã¾ããããï¼
ãããã¹ã¯ãªããã§Webãµã¼ãã¹ãå©ãå¦çãæ¸ãã¦ããããã¹ã±ã¸ã¥ã¼ã«å®è¡ãããã¨ã«ãã£ã¦ãæ¯æ¥èªåã§ã³ã¡ã³ããå¤æ´ã§ãããã§ãã
ä½ãæ¹
ä½ãæ¹ã¯è²ã ããã¾ããã©ãç§ãèãããã¤ãç´¹ä»ãã¾ãã
ã¹ãã¬ããã·ã¼ããæ°è¦ä½æ
ãªã«ã¯ã¨ããããã¹ãã¬ããã·ã¼ãæ¬ä½ããªãã¨è©±ãå§ã¾ãã¾ãããã¨ã£ã¨ã¨ä½ã£ã¦ãã¾ãã¾ãããã
ã·ã¼ãæ¬ä½
ä¸ã®æ§ãªè¡¨ãä½ãã¾ãã
Aåã«æ¬¡åã®ã¹ã¯ãªããã§è¨å®ããå
容ããâãã§æå®ãã
Båã«ã¯è¨å®ãããã³ã¡ã³ããããããã¼ã£ã¨æ¸ãã¦ããã¾ãã
ãããã¹ã¯ãªããã§å¦çãã¾ãããã£ããããã¨ä¸ã®æ§ãªæãã
- ãâããã¤ãã¦ããè¡ã®ã³ã¡ã³ããPVããã¤ã¼ããããµã¼ãã¹ã«è¨å®
- 次åã®ããã«ãâããã¤ãã¦ãè¡ãä¸ã¸ç§»åããï¼ä¸çªä¸ã¾ã§è¡ã£ã¦ããä¸çªä¸ã«ç§»åï¼
ã¹ã¯ãªãã
ã¡ãã¥ã¼ã® [ãã¼ã«]ï¼[ã¹ã¯ãªãã ã¨ãã£ã¿...] ããã¹ã¯ãªããã¨ãã£ã¿ãéãã¾ãã
ããã¦ãä¸ã®ã³ã¼ãããã¿ãã¨è²¼ãä»ãã¦ä¸ããããã¼ã¯ã³ã¯è¨å®ç»é¢ã§åå¾ãããã¼ã¯ã³ã«ç½®ãæãã¦ä¸ãããã
function changeDailyComment(){ var spreadSheet = SpreadsheetApp.getActiveSpreadsheet(); var sheet = spreadSheet.getSheets()[0]; // ä»åè¨å®ããè¡ã¨ã³ã¡ã³ããåå¾ var comment, row; for (row=2; row<=1000; row++) { var check = sheet.getRange(row,1).getValue(); if (check == "â") { comment = sheet.getRange(row,2).getValue(); break; } } // 次åäºå®ã®è¡ãåå¾ var nextRow = row + 1; var nextComment = sheet.getRange(nextRow, 2).getValue(); if (nextComment == "") { nextRow = 2; } // PVããã¤ã¼ããããµã¼ãã¹ã¸éä¿¡ Logger.log(comment); postPvTweetService(comment); // 次åäºå®ãæ´æ° sheet.getRange(row,1).setValue(""); sheet.getRange(nextRow,1).setValue("â"); } function postPvTweetService(comment){ var payload = { "ApiToken" : "[èªåãåå¾ãããã¼ã¯ã³]", "Comment" : comment }; var options = { "method" : "post", "payload" : payload }; UrlFetchApp.fetch("http://tweetpvservice.nkd.jp/api/DailyComment", options); }
ããªã¬ã¼ï¼ã¹ã±ã¸ã¥ã¼ã©ï¼ã®è¨å®
å¾ã¯ããªã¬ã¼ã®è¨å®ãããã ãã§ãã
ä¸ã®æè¨ã®ã¢ã¤ã³ã³ãã¯ãªãã¯ããã¨ããªã¬ã¼ã®ä¸è¦§ã¦ã¤ã³ãã¦ã表示ããã¾ãããããªã¬ã¼ä½ãããã£ããããã¯ãªãã¯ããããçãªãªã³ã¯ãããã¾ãã®ã§ãããã¯ãªãã¯ãã¾ãã
å®è¡å¥æ©ã¨ãªãã¤ãã³ãã¯ãã¹ãã¬ããã·ã¼ããããã¨ãæé主å°åãã®2種é¡ãããã¾ããä»åã®ç¨éã§ããã¨ãæé主å°åãã§ããã
ããã¦ãã¿ã¤ãã¼ã¯æ¬¡ã®6種é¡ããé¸æãã¾ãã
- ç¹å®ã®æ¥æ
- åã¿ã¤ãã¼
- æã¿ã¤ãã¼
- æ¥ã¿ã¤ãã¼
- é±ã¿ã¤ãã¼
- æã¿ã¤ãã¼
PVããã¤ã¼ããããµã¼ãã¹ã§ã¯æ¯æ¥1åãªã®ã§ãæ¥ã»é±ã»æã®ããããã«ãªãã¨æãã¾ããæ¥ã»é±ã»æãæå®ããã¨ããåå 0 æï½1 æãã®ãããªé¸æãè¡ãããã«ãªãã¾ããããã®éã§1åå®è¡ãããã£ã¦ãã¨ã®ããã§ãããªããªãç´æçã«ã¯ãããã¥ããã§ããã
ã¾ã¨ã
ã©ãã§ãããï¼ãããªãããªãç°¡åã«ã³ã¡ã³ããå¤æ´ã§ããã¨æãã¾ãã
ããã§ä½ã£ãã·ã¼ããå ¬éãã¦ããã¾ããã¹ã¯ãªãããè¦ãã«ã¯èªåã®ç°å¢ã«ã³ãã¼ããå¿ è¦ãããã£ã½ãã§ããèå³ããã人ã¯ãã¡ãã¥ã¼ããããã¡ã¤ã«ãï¼ãã³ãã¼ãä½æããã¦ã¿ã¦ä¸ããã
ããã¾ãã