Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function pad(v, size) {
- if (v == undefined) return "00";
- var s = String(v);
- while (s.length < (size || 2)) {s = "0" + s;}
- return s;
- }
- function P(keyword, serverCode) {
- if (!serverCode) serverCode = "KYPROSA";
- if (!keyword) return 0;
- var resp = JSON.parse(UrlFetchApp.fetch("https://project-arche.appspot.com/api/auctions/" + serverCode + "/" + keyword).getContentText());
- if (resp.length == 0) return 0;
- var price = resp[0].SinglePrice;
- return pad(price.Gold, 0) + "." + pad(price.Silver) + pad(price.Bronze);
- }
- function refresh() {
- SpreadsheetApp.getActiveSpreadsheet().getRange('C1').setValue(new Date().toTimeString());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement