Skip to content

Instantly share code, notes, and snippets.

@castaneai
Created March 18, 2019 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save castaneai/637ae6fb7fb1380c37e992d274a0ea19 to your computer and use it in GitHub Desktop.
Save castaneai/637ae6fb7fb1380c37e992d274a0ea19 to your computer and use it in GitHub Desktop.
tbf06 checked count
function fetch() {
var headers = {"Cookie": "user=xxxxxxxxxxxxxxxxxx;"}; // <- insert your cookie here
var params = {
"method": "GET",
"headers": headers,
};
var url = "https://techbookfest.org/api/circle/own";
var resp = UrlFetchApp.fetch(url, params);
return JSON.parse(resp.getContentText());
}
function check() {
var resp = fetch();
var checkedCount = resp[0].checkedCount;
var sheet = SpreadsheetApp.getActiveSheet();
sheet.insertRows(2, 1);
sheet.getRange(2, 1, 1, 2).setValues([[new Date(), checkedCount]]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment