Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getPointp(apiKey) {
- var url = 'https://api.torn.com/market/?selections=pointsmarket&key='+ apiKey;
- var options = {
- 'method' : 'post',
- 'contentType': 'application/json',
- 'muteHttpExceptions': true
- };
- var res = UrlFetchApp.fetch(url, options);
- var resText = res.getContentText();
- var respOBJ = JSON.parse(resText).pointsmarket;
- var IDs = Object.keys(respOBJ);
- var values = [];
- for(i = 0; i < 1; i++) {
- values.push(respOBJ[IDs[i]].cost);
- }
- if (values.length > 0) {
- return Math.min.apply(null, values);
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment