Sunday, 8 September 2013

Trying to get this script to run update on a timer

Trying to get this script to run update on a timer

Been trying to just the triggers but they don't seem to work so I had
figured that I could just script it. I have tried the setInterval command
but it don't seem to work.
var myVar=setInterval(function(){getItemSellValue(itemID)()},60000);
function getItemSellValue(itemID)
{
var myUrl = "http://www.gw2spidy.com/api/v0.9/json/item/" + escape(itemID);
var jsonData = UrlFetchApp.fetch(myUrl);
Utilities.sleep(2000)
var jsonString = jsonData.getContentText();
var jsonObject = JSON.parse(jsonString).result;
var adjustedValue = (jsonObject.min_sale_unit_price / 100);
return adjustedValue;
clearInterval(myVar);
}

No comments:

Post a Comment