Skip to content

Instantly share code, notes, and snippets.

@hitode909
Created December 23, 2018 20:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hitode909/41947f3978240d3f42dbe10deeed00a4 to your computer and use it in GitHub Desktop.
Save hitode909/41947f3978240d3f42dbe10deeed00a4 to your computer and use it in GitHub Desktop.
つくりおきメトリクス
function crawl() {
var content = UrlFetchApp.fetch("https://tsukurioki.hatenablog.com/about").getContentText();
var entries = content.match(/(\d+) 記事/)[1];
var subscribers = content.match(/(\d+) 人/)[1];
Logger.log(subscribers);
var sheet = SpreadsheetApp.openById("*************************").getSheetByName('data');
var newRow = [new Date(), +entries, +subscribers];
sheet.appendRow(newRow);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment