Pages: [1] :: one page |
|
Author |
Thread Statistics | Show CCP posts - 0 post(s) |
Dean Hekki
School of Applied Knowledge Caldari State
1
|
Posted - 2015.04.19 22:35:02 -
[1] - Quote
Ok, this is annoying, can anyone see what is wrong with this?
=IMPORTXML("https://api.eveonline.com/Account/Characters.xml.aspx?keyID=XXXX&vCode=YYYY", "//name")
The link works but it will only spit out a N/A
a browser shows its the right URL anyway |
Kali Izia
GoomWaffe Goonswarm Federation
45
|
Posted - 2015.04.19 23:22:51 -
[2] - Quote
Your "//name" xpath means you're looking for a tag called name which doesn't exist. To get an attribute called name you want to do something like -¦//row/@name-¦. |
Dean Hekki
School of Applied Knowledge Caldari State
1
|
Posted - 2015.04.19 23:26:13 -
[3] - Quote
Works like a charm Thank you! :)
|
Dean Hekki
School of Applied Knowledge Caldari State
1
|
Posted - 2015.04.19 23:44:27 -
[4] - Quote
So followup question so I can understand better
why wont changing that to name to characterID or corporationName work?
Sorry for being dumb with this but I'm still learning, Im a fast learner once I grasp the concept but I gotta grasp it first :)
I was looking at: http://www.w3schools.com/xpath/xpath_syntax.asp but so far all Ive been able to get is name, and a wildcard of everything there is lol |
Steve Ronuken
Fuzzwork Enterprises Vote Steve Ronuken for CSM
5179
|
Posted - 2015.04.19 23:55:08 -
[5] - Quote
Google screws with the xml, lower casing all attribute names and node names.
if you look for characterid, you should find it.
https://github.com/fuzzysteve/eve-googledocs-script may be of interest, for an alternate way to work with xml, which is substantially more flexible than importxml
Woo! CSM X!
Fuzzwork Enterprises
Twitter: @fuzzysteve on Twitter
|
Dean Hekki
School of Applied Knowledge Caldari State
1
|
Posted - 2015.04.20 00:13:24 -
[6] - Quote
Thanks, I'll start working on learning that since what I want to do is much more complicated than a simple character ID
I can feel the migraines coming on already. :) |
Dean Hekki
School of Applied Knowledge Caldari State
1
|
Posted - 2015.04.20 00:51:08 -
[7] - Quote
ok so Ive got this so far
function charID(character,keyID,Vcode){ if (typeof character == 'undefined'){ throw 'Need Character'; }
if (typeof keyID == 'undefined'){ keyID=XXXX; }
if (typeof Vcode == 'undefined'){ Vcode=XXXXX; }
var url = "https://api.eveonline.com/Account/Characters.xml.aspx?keyID="+keyID+"&vCode"+Vcode; var parameters = {method : "get", payload : ""}; var xmlFeed = UrlFetchApp.fetch(url, parameters).getContentText(); var xml = XmlService.parse(xmlFeed);
if(xml) { var rows=xml.getRootElement().getChild("result").getChildren("rowset"); }
}
Currently I have my ID and Vcode as default so I can figure out the rest I want it set up so I enter the character for instance charID(Dean Hekki)
This is very basic but its a learning point for me, I try to start out with a single thing then expand from there so I can learn what is going on... Could you tell me if Im at least on the right track, I get confused from here on so trying to figure it out. |
Dean Hekki
School of Applied Knowledge Caldari State
1
|
Posted - 2015.04.20 01:59:44 -
[8] - Quote
moral of the story for me today is I hate javascript
Give me php anyday |
Dean Hekki
School of Applied Knowledge Caldari State
1
|
Posted - 2015.04.20 02:41:09 -
[9] - Quote
holy crap I got it
function loadSheet(keyID, vCode){ var sheets= new Array(); var url = "https://api.eveonline.com/Account/Characters.xml.aspx?keyID="+keyID+"&vCode="+vCode; var parameters = {method : "get", payload : ""}; var xmlFeed = UrlFetchApp.fetch(url, parameters).getContentText(); var xml = XmlService.parse(xmlFeed); if(xml) { var rows=xml.getRootElement().getChild("result").getChild("rowset").getChildren("row"); for(var i = 0; i < rows.length; i++) { sheet=[rows[i].getAttribute("name").getValue(), rows[i].getAttribute("characterID").getValue(), rows[i].getAttribute("corporationName").getValue(), rows[i].getAttribute("corporationID").getValue(), rows[i].getAttribute("allianceID").getValue(), rows[i].getAttribute("allianceName").getValue(), rows[i].getAttribute("factionID").getValue(), rows[i].getAttribute("factionName").getValue()] sheets.push(sheet); } } return sheets; }
its a start lol |
Lemkor Gengod
Stacmon Production and Trade Institue
1
|
Posted - 2015.04.22 21:26:30 -
[10] - Quote
Steve Ronuken wrote:Google screws with the xml, lower casing all attribute names and node names. if you look for characterid, you should find it. https://github.com/fuzzysteve/eve-googledocs-script may be of interest, for an alternate way to work with xml, which is substantially more flexible than importxml
And it appears within hours of you writing that, Google has fixed the issue that has been around for years
https://forums.eveonline.com/default.aspx?g=posts&t=420225&find=unread
Steve, do you get the feeling that somebody at Google is stalking your internet presence?
|
|
salacious necrosis
Federal Defense Union Gallente Federation
13
|
Posted - 2015.04.23 02:53:44 -
[11] - Quote
Dean Hekki wrote:holy crap I got it
function loadSheet(keyID, vCode){ var sheets= new Array(); var url = "https://api.eveonline.com/Account/Characters.xml.aspx?keyID="+keyID+"&vCode="+vCode; var parameters = {method : "get", payload : ""}; var xmlFeed = UrlFetchApp.fetch(url, parameters).getContentText(); var xml = XmlService.parse(xmlFeed); if(xml) { var rows=xml.getRootElement().getChild("result").getChild("rowset").getChildren("row"); for(var i = 0; i < rows.length; i++) { sheet=[rows[i].getAttribute("name").getValue(), rows[i].getAttribute("characterID").getValue(), rows[i].getAttribute("corporationName").getValue(), rows[i].getAttribute("corporationID").getValue(), rows[i].getAttribute("allianceID").getValue(), rows[i].getAttribute("allianceName").getValue(), rows[i].getAttribute("factionID").getValue(), rows[i].getAttribute("factionName").getValue()] sheets.push(sheet); } } return sheets; }
its a start lol
You may want to try this if you need more than just the character sheet:
https://www.eve-kit.org/#/main/doc/1416194988795
and the accompanying video:
https://www.youtube.com/watch?v=qVsOldt6RQ4&feature=youtu.be
EveKit - your EVE data on the web!
|
|
|
|
Pages: [1] :: one page |
First page | Previous page | Next page | Last page |