These forums have been archived and are now read-only.
The new forums are live and can be found at https://forums.eveonline.com/
Steve's Github code
function loadSystemPrices(priceIDs,systemID,cachebuster){ if (typeof systemID == 'undefined'){ systemID=30000142; } if (typeof priceIDs == 'undefined'){ throw 'need typeids'; } if (typeof cachebuster == 'undefined'){ cachebuster=1; } var prices = new Array(); var dirtyTypeIds = new Array(); var cleanTypeIds = new Array(); var url="http://api.eve-central.com/api/marketstat?cachebuster="+cachebuster+"&usesystem="+systemID+"&typeid="; priceIDs.forEach (function (row) { row.forEach ( function (cell) { if (typeof(cell) === 'number' ) { dirtyTypeIds.push(cell); } }); }); cleanTypeIds = dirtyTypeIds.filter(function(v,i,a) { return a.indexOf(v)===i; }); var parameters = {method : "get", payload : ""}; var o,j,temparray,chunk = 100; for (o=0,j=cleanTypeIds.length; o < j; o+=chunk) { temparray = cleanTypeIds.slice(o,o+chunk); var xmlFeed = UrlFetchApp.fetch(url+temparray.join("&typeid="), parameters).getContentText(); var xml = XmlService.parse(xmlFeed); if(xml) { var rows=xml.getRootElement().getChild("marketstat").getChildren("type"); for(var i = 0; i < rows.length; i++) { var price=[parseFloat(rows[i].getChild("buy").getChild("max").getValue()), parseFloat(rows[i].getChild("sell").getChild("min").getValue())]; prices.push(price); } } } return prices;}
priceIDs.forEach (function (row) { row.forEach ( function (cell) { if (typeof(cell) === 'number' ) { dirtyTypeIds.push(cell);
Woo! CSM XI!
Fuzzwork Enterprises
Twitter: @fuzzysteve on Twitter