These forums have been archived and are now read-only.
The new forums are live and can be found at https://forums.eveonline.com/
Google Apps Script Discussion
Woo! CSM XI!
Fuzzwork Enterprises
Twitter: @fuzzysteve on Twitter
//Converts the EVE api XML to a useable array format.function eveXMLToArray(url) { var xml = UrlFetchApp.fetch(url).getContentText(); var document = XmlService.parse(xml); var rowset = document.getRootElement().getChild('result').getChild('rowset'); var attributes = rowset.getAttribute('columns').getValue().split(','); var children = rowset.getChildren(); var prefill = []; var res = [[]] while ( res.length < attributes.length + 1 ) { res.push([]); }; while ( prefill.length < attributes.length ) { prefill.push('#NULL') }; prefill.push(-1); res = eveAPICrawler(children,attributes,prefill,res); return res};//Subfunction of eveXMLToArray(). Converts the raw data to a readable array format.function eveAPICrawler(children,attributes,prefill,res) { prefill[attributes.length] += 1; var subchildren = []; var subprefill = []; var i = 0; var value = ''; while ( i < children.length ) { while ( subprefill.length < attributes.length ) { try { value = children[i].getAttribute(attributes[subprefill.length]).getValue(); res[subprefill.length].push(value); subprefill.push(value) } catch (e) { res[subprefill.length].push(prefill[subprefill.length]); subprefill.push(prefill[subprefill.length]) } }; res[subprefill.length].push(prefill[attributes.length]); subprefill.push(prefill[attributes.length]) try { subchildren = children[i].getChildren()[0].getChildren(); res = eveAPICrawler(subchildren,attributes,subprefill,res) } catch (e) {}; subchildren = []; subprefill = []; i += 1 }; return res};
value = children[i].getAttribute(attributes[subprefill.length]).getValue();value = isNumeric(value)?parseFloat(value):value;
function IsNumeric(input){ return (input - 0) == input && input.length > 0;}
for(var i = 0; i < rows.length; i++) { runs = +rows[i].getAttribute("runs").getValue(); blueprint=[rows[i].getAttribute("itemID").getValue(), rows[i].getAttribute("locationID").getValue(), rows[i].getAttribute("typeID").getValue(), rows[i].getAttribute("typeName").getValue(), rows[i].getAttribute("flagID").getValue(), rows[i].getAttribute("quantity").getValue(), rows[i].getAttribute("timeEfficiency").getValue(), rows[i].getAttribute("materialEfficiency").getValue(), runs] blueprints.push(blueprint); }
isNaN(Value)
value = isNaN(value)?value:parseFloat(value);
Use EveKit ! - Tools for EVE Online 3rd party development
(form id="frm1" name = "mat_add")(input width="1000" type="text" name="mat" value="Enter Item Here")(br /)(input type="hidden" id="tab_array" name="tab_array")(input type="button" value="Submit" name="mat_sub" onclick="document.getElementById('tab_array').value=document.getElementById('spn1').innerHTML; google.script.run.withSuccessHandler(onSuccess).shortlist(this.parentNode)")(/form)
function shortlist(form) { var table = form.tab_array; ...