--------------------以下未踏----------------------------------
https://www.lifenlogic.com/is-easy-nocode-preliminary/
https://qiita.com/Brutus/items/efbd5fda4c9316fc9e3b
https://ex-ture.com/blog/2022/12/21/google-app-script%E3%81%A8google%E3%82%B9%E3%83%97%E3%83%AC%E3%83%83%E3%83%89%E3%82%B7%E3%83%BC%E3%83%88%E3%82%92%E9%80%A3%E6%90%BA%E3%81%95%E3%81%9B%E3%82%8B/
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
https://www2.kobe-u.ac.jp/~tnishida/programming/GAS-01.html など参照
// The code below will send an email with the current date and time.
function doGet(){
hot100();
}
;
const now = new Date();
GmailApp.sendEmail(
'fseigojp@gmail.com',
'current time',
`The time is: ${now.toString()}`,
);
function hot100(){
let url = "http://www.billboard-japan.com/charts/detail?a=hot100"; // 取得するページのURL。一度ブラウザで開いて見てみるといいでしょう。
let response = UrlFetchApp.fetch(url);
let text = response.getContentText(); // 取得したHTML文字列
let ss = SpreadsheetApp.getActive();
let sheet = ss.getSheetByName("Sheet1");
let pattern = /<p class="musuc_title">([^<>]*)<\/p>/g
let match;
while(match = pattern.exec(text)){
sheet.appendRow([match[1]]);
}
}
0 件のコメント:
コメントを投稿