These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

Importing Character imformation into Google docs?

Author
Iluan
Republic Military School
Minmatar Republic
#1 - 2013-11-08 02:58:22 UTC  |  Edited by: Iluan
Can anyone point me in the right direction?

I am trying to import char sheet info into my Google docs. With one row corresponding to a char. and multiple row/chars.

What I would like to achieve:

http://imgur.com/FAycBtD


Grateful for any help, thanks!
Louis Vitton
Viziam
Amarr Empire
#2 - 2013-11-08 05:02:48 UTC
Iluan
Republic Military School
Minmatar Republic
#3 - 2013-11-08 05:42:52 UTC


Yeah I saw that. I went back about 30 pages or more in this thread and Googled everything I could. I can not find a definitive answer. Or anything even remotely close for that matter. =/

i will link an image to show what i am trying to achieve

http://imgur.com/FAycBtD

Here is how I'd like it to function. The above image. Pulling data into each row for each char.
Elmore Jones
New Eden Mining Organisation
The Craftsmen
#4 - 2013-11-08 09:56:41 UTC
The API call you need for each cell are detailed here : Category:API

For ease I'd suggest a hidden column or locked 2nd sheet to hold the appropriate api access keys for your chars.

So, for example your Account Status cell :

=ImportXML(" https://api.eveonline.com/account/AccountStatus.xml.aspx?userID&apiKey&characterID OR keyID&vCode&characterID")

Each cell will then perform its own call to the API per funtion as listed in the link above. You should be aware that GoogleDocs has a limit of 50 individual ImportXML() calls per document. Hope this helps :)

+++ Reality Error 404 - Reboot Cosmos +++

Iluan
Republic Military School
Minmatar Republic
#5 - 2013-11-08 11:03:13 UTC
Elmore Jones wrote:
The API call you need for each cell are detailed here : Category:API

For ease I'd suggest a hidden column or locked 2nd sheet to hold the appropriate api access keys for your chars.

So, for example your Account Status cell :

=ImportXML(" https://api.eveonline.com/account/AccountStatus.xml.aspx?userID&apiKey&characterID OR keyID&vCode&characterID")

Each cell will then perform its own call to the API per funtion as listed in the link above. You should be aware that GoogleDocs has a limit of 50 individual ImportXML() calls per document. Hope this helps :)



Thanks for the info! Makes more sense now.

I used your method above and could not get it to function. I may have not done something or done to much. the ONLY thing I did was paste the following straight into a cell.

=ImportXML("https://api.eveonline.com/account/AccountStatus.xml.aspx?keyid=0000000&vcode=0000000000000000000000000000000000000000000000000")

0's replaced by my API.

I get an error in the cell saying #N/A with a note of "error: Wrong number of arguments to ImportXml"

Any ideas?
Elmore Jones
New Eden Mining Organisation
The Craftsmen
#6 - 2013-11-08 11:13:30 UTC  |  Edited by: Elmore Jones
Yes mate, you didn't pass all the required arguments :P You passed only keyID + vcode. You need to pass userID, apikey,characterID OR keyID, vCode and finally characterID just as i posted above :)

EDIT : look at whats highlighted orange too... EVE forums dont seem to handle posting html examples well :(

+++ Reality Error 404 - Reboot Cosmos +++

Yukie Valentine
School of Applied Knowledge
Caldari State
#7 - 2013-11-08 11:22:37 UTC
Iluan wrote:

=ImportXML("https://api.eveonline.com/account/AccountStatus.xml.aspx?keyid=0000000&vcode=0000000000000000000000000000000000000000000000000")

0's replaced by my API.

I get an error in the cell saying #N/A with a note of "error: Wrong number of arguments to ImportXml"

Any ideas?

You have to define which value it's supposed to read.

Also this api only contains account information such as "paidUntil, createDate, logonCount, logonMinutes"

So for example if you want to know how long u've played in total on your account, you have to define "loginMinutes" as the value you want in the ImportXML string.

If you don't define which value it's suppose to grab, it will return an error since you didn't specify what it's supposed to do.

If you want individual characters you have to use:

https://api.eveonline.com/eve/CharacterInfo.xml.aspx

You can get the character ID's from:

https://api.eveonline.com/eve/CharacterID.xml.aspx

You can use the wiki for refference, it's quite helpful

https://wiki.eveonline.com/en/wiki/EVE_API_Functions
Yukie Valentine
School of Applied Knowledge
Caldari State
#8 - 2013-11-08 11:24:16 UTC
Elmore Jones wrote:
Yes mate, you didn't pass all the required arguments :P You passed only keyID + vcode. You need to pass userID, apikey,characterID OR keyID, vCode and finally characterID just as i posted above :)

EDIT : look at whats highlighted orange too... EVE forums dont seem to handle posting html examples well :(

You have define an argument for ImportXML otherwise it doesn't know which data to pull.
Iluan
Republic Military School
Minmatar Republic
#9 - 2013-11-08 11:45:19 UTC  |  Edited by: Iluan
Yukie Valentine wrote:
Elmore Jones wrote:
Yes mate, you didn't pass all the required arguments :P You passed only keyID + vcode. You need to pass userID, apikey,characterID OR keyID, vCode and finally characterID just as i posted above :)

EDIT : look at whats highlighted orange too... EVE forums dont seem to handle posting html examples well :(

You have define an argument for ImportXML otherwise it doesn't know which data to pull.


I updated it to the following:

=ImportXML("https://api.eveonline.com/account/AccountStatus.xml.aspx?keyid=00000000&vcode=0000000000000000000000000000000000000&characterID=0000000000")

Still can not get it to work. Assuming there is even more that I am missing? I've read the documentation. Can't find out what.

EDIT: Your saying "OR" Use either or? Or is "OR" being used as an operator of some sort...
Yukie Valentine
School of Applied Knowledge
Caldari State
#10 - 2013-11-08 12:14:55 UTC
Iluan wrote:
Yukie Valentine wrote:
Elmore Jones wrote:
Yes mate, you didn't pass all the required arguments :P You passed only keyID + vcode. You need to pass userID, apikey,characterID OR keyID, vCode and finally characterID just as i posted above :)

EDIT : look at whats highlighted orange too... EVE forums dont seem to handle posting html examples well :(

You have define an argument for ImportXML otherwise it doesn't know which data to pull.


I updated it to the following:

=ImportXML("https://api.eveonline.com/account/AccountStatus.xml.aspx?keyid=00000000&vcode=0000000000000000000000000000000000000&characterID=0000000000")

Still can not get it to work. Assuming there is even more that I am missing? I've read the documentation. Can't find out what.

EDIT: Your saying "OR" Use either or? Or is "OR" being used as an operator of some sort...

The code you have pulls up all the information for "AccountStatus" for it to work in google docs, you have to add defined argument at the end, or it doesn't know what to do.
Iluan
Republic Military School
Minmatar Republic
#11 - 2013-11-08 12:28:03 UTC
Yukie Valentine wrote:
Iluan wrote:
Yukie Valentine wrote:
Elmore Jones wrote:
Yes mate, you didn't pass all the required arguments :P You passed only keyID + vcode. You need to pass userID, apikey,characterID OR keyID, vCode and finally characterID just as i posted above :)

EDIT : look at whats highlighted orange too... EVE forums dont seem to handle posting html examples well :(

You have define an argument for ImportXML otherwise it doesn't know which data to pull.


I updated it to the following:

=ImportXML("https://api.eveonline.com/account/AccountStatus.xml.aspx?keyid=00000000&vcode=0000000000000000000000000000000000000&characterID=0000000000")

Still can not get it to work. Assuming there is even more that I am missing? I've read the documentation. Can't find out what.

EDIT: Your saying "OR" Use either or? Or is "OR" being used as an operator of some sort...

The code you have pulls up all the information for "AccountStatus" for it to work in google docs, you have to add defined argument at the end, or it doesn't know what to do.


Ohhh ok. That was the part I was confused on. I was thinking that the vcode, userID, etc, etc, were the arguments that it took.

May I ask how to add on these arguments in which you speak? Or where I can find them, or something that shows me the context in which they are added? Thanks! Almost there!
Elmore Jones
New Eden Mining Organisation
The Craftsmen
#12 - 2013-11-08 14:08:43 UTC
They are the arguments. And you have to give all of them, not just 2 or 3 :) And OR is a choice not a logical op :P

Read the link at top of my first post. its spelled out for you.

+++ Reality Error 404 - Reboot Cosmos +++

Iluan
Republic Military School
Minmatar Republic
#13 - 2013-11-08 15:15:31 UTC  |  Edited by: Iluan
Elmore Jones wrote:
They are the arguments. And you have to give all of them, not just 2 or 3 :) And OR is a choice not a logical op :P

Read the link at top of my first post. its spelled out for you.


See, that's why I am confused. Your saying I have to use all of them. I did use them all didn't I?

=ImportXML("https://api.eveonline.com/account/AccountStatus.xml.aspx?keyid=00000000&vcode=0000000000000000000000000000000000000&characterID=0000000000")

keyID
vcode
characterID

OR (non logical OP)

keyID
vCode
characterID

I used the top 3 arguments. You listed only two sets of arguments to chose from.

=ImportXML(" https://api.eveonline.com/account/AccountStatus.xml.aspx?userID&apiKey&characterID OR keyID&vCode&characterID")

I went with the 3 arguments after the OR rather than the first 3 userID, apiKey, and characterID.

You just said in your last post tho that i have to use them all not just 2 or 3. I don't understand cause you basically said use the first 3 arguments OR use the second 3 You listed only 2 sets arguments. the 3 arguments before the Or and the 3 arguments after the or.

I am definitively grateful you are helping me understand this and I apologize that I am not picking it up. I read the link you linked. It does not, nor does any other documentation, SHOW me the context in which I write out the line of code. The link you gave me at the top of your post. I understand that it tells me how to make the calls and which arguments each call takes. My problem is I have NO idea how to write out the call. If i knew i could easily apply it to each one of the calls I would like to make.

It's not for the lack of trying I spent 8 hours last night working on this and a few other things and I've yet to fully understand how to make it work. Could you literally write out the line of code I need? Once i see how it functions and is written I can apply it to all the other imports i want to make via the resource link you gave me. I just do not understand how to write it out.

this is my current line of code

=ImportXML("https://api.eveonline.com/account/AccountStatus.xml.aspx?keyid=&vcode=&characterID=")

I've given it the 3 arguments. You are saying it takes more than 3 arguments? Alright. Which ones? You listed only 6, 2 sets of 3. How is it written? What context is it written in? I understand what the arguments are, I understand how to write each argument out as written above. I do not, however, know how to write the entire line with everything required. Sorry for the repetitiveness of my post but I wanted to make sure I was clear as apparently you think what you typed is some obvious fact. I'm sure it is. But obvious to someone who knows what to look for. I do not. I am apparently clueless. lol.


Thanks man. Hope you can have just a little more patience with me. =)
Elmore Jones
New Eden Mining Organisation
The Craftsmen
#14 - 2013-11-08 21:30:05 UTC  |  Edited by: Elmore Jones
There's 5 arguments. youa re misunderstanding the OR.

https://api.eveonline.com/account/AccountStatus.xml.aspx?userID&apiKey&characterID OR keyID&vCode&characterID

OR means a choice of character ID OR keyID. The rest are mandatory.

EDIT : Please do use the link supplied on my first post. The API docs are pretty good and will let you progress to doing more in your sheet, and show you what info is returned that might need processing.

+++ Reality Error 404 - Reboot Cosmos +++

Abdiel Kavash
Deep Core Mining Inc.
Caldari State
#15 - 2013-11-11 22:00:35 UTC  |  Edited by: Abdiel Kavash
First, literally every reply in this thread is wrong, please ignore it. (No offense.)

To get the importXML function to work, you need to supply two things: the XML file to be parsed (first argument) and an XPath query specifying which information from the file you want (second argument). Read more about XPath here.

For a reference on all the API calls, http://wiki.eve-id.net/APIv2_Page_Index is much more complete and updated than the official site.

Here I will write a short tutorial showcasing at least the basic concepts.

Arrow

Let's start with something really simple: the subscription expiration date of an account. Take a look at http://wiki.eve-id.net/APIv2_Account_AccountStatus_XML . You will see that the API call is "/account/AccountStatus.xml.aspx" and the required parameters are keyID and vCode. (I hope you know what these are.) Therefore the URL for the XML file you need would be:

https://api.eveonline.com/account/AccountStatus.xml.aspx?keyID=123456&vCode=0123456789ABCDEF

If you put in valid data, you should be able to open the XML as a web page in any modern browser.

You are looking for the paidUntil tag, so the XPath query (refer to the tutorial I linked above) would be "//paidUntil". Therefore the easiest way to get this into a cell would be writing the following:

=importXML("https://api.eveonline.com/account/AccountStatus.xml.aspx?keyID=123456&vCode=0123456789ABCDEF", "//paidUntil")

Keep in mind that the arguments are case-sensitive! Writing "paidUntil" works, "paiduntil" doesn't!

Arrow

Onto more advanced stuff! First, I always like to split the URL creating process into little bits that you can easily modify. So follow along: In cell A1, I put "keyID". In A2, I put "vCode". In A3, I put "call". In A4, I put "URL". Now fill in the data: in B1, copy your keyID from the API page. In B2, copy your vCode. In B3, put in "/account/AccountStatus.xml.axpx". And in B4 put in the following formula:

=concatenate("https://api.eveonline.com", B3, "?keyID=", $B$1, "&vCode=", $B$2)

If you've done this right, the URL from before should appear. You can click on the cell and follow the link. If the XML file appears, you've done everything right!

Now, having the URL in one cell, the importXML call will be much easier to write. In cell A5, put in:

=importXML(B4, "//paidUntil")

Voila, your account expiration date!

Arrow

Now let's move on to something more advanced. Let's say you want a list of characters on your account. We will use the http://wiki.eve-id.net/APIv2_Account_Characters_XML API call. Write "call" in cell A8, and "URL" in A9. Put "/account/Characters.xml.aspx" in B8. In B9, copy and paste the formula from B4. It should look like this:

=concatenate("https://api.eveonline.com", B8, "?keyID=", $B$1, "&vCode=", $B$2)

Remember that B1 and B2 are your keyID and vCode respectively. See why I put them all in one place? You can check the URL to see if it points to a valid XML file.

Now to get a list of character names. Looking at the API reference, you are looking for an attribute "name" of the XML tag "row". In XPath, this would be "//row/@name". So the formula for getting all the character names is (put this in A10):

=importXML(B9, "//row/@name")

If you have more than one character on your account, you will see that the formula automatically expands downwards to take up as many cells as necessary. This is fine! Now try to use the same API to get your characters' corporation names (put this in cell B10) and character IDs - we will need them later (put them in C10).

Now, if you're working with me and not skipping ahead, you will have hit a caveat: using =importXML(B9, "//row/@corporationName") doesn't work! (Error: The XPath query did not return any data.) Remember what I said earlier about XPath being case-sensitive? Well, for whatever reason, whenever you are querying an attribute, you need to use all lower-case letters. :CCP: I assume. Therefore the correct syntax is =importXML(B9, "//row/@corporationname"). Now try importing the character IDs again!

Arrow

Great, if you followed up to here and everything works, you get the basic principles! Let's take a look at character calls next. Let's find the alliance your character is in. For whatever reason (:CCP:) this is not in /account/Characters, you have to look in http://wiki.eve-id.net/APIv2_Char_CharacterSheet_XML . Note that in addition to the API keyID and vCode, this call also requires a character ID. Remember when I told you to get a list of them, that they will be useful?

Let's keep everything tidy and put "call" in cell A15, "URL" in A16, and "/char/CharacterSheet.xml.aspx" in B15. Try using what you've learned so far to figure out how can you piece the URL together!

The line you're looking for (in cell B16) is:

=concatenate("https://api.eveonline.com", B15, "?keyID=", $B$1, "&vCode=", $B$2, "&characterID=", $C$10)

If you've followed my instruction to the letter, C10 will be the ID of your first character. (Feel free to switch this to point to any of your characters.) And looking at the API reference, you are looking for the XML tag "allianceName". You should be able to come up with the simple importXML statement yourself! If not, here it is, let's put it in A17:

=importXML(B16, "//allianceName")

(Obviously this will only work if your character is in an alliance, otherwise you get an error! If you don't have a character in an alliance, try pulling your bloodline or your clone name.)

Arrow
Abdiel Kavash
Deep Core Mining Inc.
Caldari State
#16 - 2013-11-11 22:03:37 UTC

Finally, let's try to get the total number of skill points your character has. Unfortunately, there is no "skillPoints" tag in CharacterInfo, or anywhere else. The only thing you have is a list of all trained skills in CharacterInfo. Fortunately this gives you the number of SP you have in every skill - but it's up to you to add them up.

Let's import these SP numbers somewhere out of the way - I will use cell F1, in a real application you would probably want them in a separate sheet. You are looking for the "skillpoints" attribute of the "row" tag, so the command will be:

=importXML(B16, "//row/@skillpoints")

This should result in a looooooong column of numbers - the number of SP you have in each injected skill. To get the total number, simply add them up together:

=sum(F1:F230)

I had to go all the way to 230(ish) to cover all of my skills. But remember, your character will train new skills - so you probably want the range to extend much further! There is no real harm in doing something like =sum(F1:F500).

Arrow

This concludes the tutorial. I hope you managed to get everything working! If you have any more questions, please ask.
Iluan
Republic Military School
Minmatar Republic
#17 - 2013-11-11 22:59:59 UTC
You sir are my goddamn hero. =D I'm to tired to think. Off work. I'll respond to this more in depth in the AM after sleep. Thanks for taking the time to write this.
Elmore Jones
New Eden Mining Organisation
The Craftsmen
#18 - 2013-11-12 06:56:40 UTC
I see I failed hard. My apologies Iluan and thanks Abdiel for setting us straight

+++ Reality Error 404 - Reboot Cosmos +++