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.
 

EVE API and Google docs

Author
Invictra Atreides
Toward the Terra
#1 - 2012-01-26 19:55:53 UTC
I hit the importXML() limit and I would like to add some more data to my spreadsheets.

I use this link as specified by the EVE wiki
https://api.eveonline.com/account/characters.xml.aspx?userID=#####&apiKey=#########


So how do I get the data from 2 characters in one importXML call?

Something like EVE Marketeer:
ʺhttp://www.evemarketeer.com/api/info/2268_2305_2267_2288_2287_2307_2272_2309_2073_2310_2270_2306_2286_2311_2308

ID1 = 2268
ID2 = 2305
ID3 = 2267
.
.
.

Is this actually possible ?

BlogTutorials | Youtube "I don’t know everything, I just know what I know."

Max Kolonko
Caldari Provisions
Caldari State
#2 - 2012-01-26 22:59:53 UTC
You dont. Sorry. You have to make separate calls for each char
Invictra Atreides
Toward the Terra
#3 - 2012-01-26 23:08:56 UTC
I see google docs support some scripts. Maybe I could use it to make 1 importXML call at a time and cycle trough 60 userIDs ?

BlogTutorials | Youtube "I don’t know everything, I just know what I know."

Louis Vitton
Viziam
Amarr Empire
#4 - 2012-01-27 01:07:42 UTC
Hey there,

I am not 100% sure how the goggle ImportXML works but i have worked with it on eve central data before.

Couldnt you use 1 line for one call then the next for the next call and just have a page dedicated to doing all the calls for you?

eg,


  1. https://api.eveonline.com/account/characters.xml.aspx?userID=#####&apiKey=########1
  2. https://api.eveonline.com/account/characters.xml.aspx?userID=#####&apiKey=########2
  3. And so on and then output the information from that you want.


May i ask are you using this specifically for something in goggle docs or are you using this cause its easier to learn? Yapeal and Pheal are 2 very good php library which will allow you to do this and much much more with little php know how.
Invictra Atreides
Toward the Terra
#5 - 2012-01-27 09:12:54 UTC
@Louis Vitton Are you saying that I could transfer data from spreadsheet 1 to spreadsheet 2 ? If that is possible then it might solve the problem of the 50 limit importXML.

I'm doing this because its fun. I don't think it has any advantages doing it in google docs over php or other languages.

BlogTutorials | Youtube "I don’t know everything, I just know what I know."

Louis Vitton
Viziam
Amarr Empire
#6 - 2012-01-27 10:41:25 UTC
As i understand and have worked with goggle docs its alot like excel and you can link cells from 1 sheet to another. I am not sure if you can link cells from 1 file to another though.

The best way to do what you want with a large number of calls is to use a library.

The API will ban your IP which will be goggles one if your requests continue to not respect the cache timer or are faulty requests.

using both php and MySql what you want can be done very quickly in 1 script and displayed on 1 page.

Pheal would prob be the easiest library to use it is php based.

Cheers Louis.

PS - I know it sounds like i dont like using goggle docs but it doesn't handle the errors and if used by many people you can get it banned from the sheer number of calls not respecting the cache timer.
Louis Vitton
Viziam
Amarr Empire
#7 - 2012-01-30 07:57:47 UTC
Sorta curious how did u go on this?
viziel
Sarum Industrial Cartel
#8 - 2012-02-02 14:40:56 UTC  |  Edited by: viziel
Just to add my my current usage to this thread for those who are looking to solve similar problems.

The issue I have is the limitation of the number of times you can use functions like ImportXML(). There are ways around this, and I will detail below the three ways that I use google docs and eve api to gather data.

Get around the 50 formula limit by creating more spreadsheets. This isn't pretty but if you can centralize your data, and then reference it instead of re-creating it every time that will help. For example, I like to track my inventory of ORE and its value, which I can then use on other spreadsheets. So, I create 1 spreadsheet with ORE values and QTY and VALUE. I have also created a custom API key that JUST shows assets (either corporate or personal). Here are some of the formulas I use:

To get character assets I use this:
=ImportXML("https://api.eveonline.com/char/AssetList.xml.aspx?vcode=??????????&keyID=??????", "sum(//row[@typeid=37]/@quantity)")

To get values from eve-central I use this:

=ImportXML("http://eve-central.com/api/marketstat?typeid="&$E4&"&typeid="&$E5&"&typeid="&$E6&"&typeid="&$E7&"&typeid="&$E8&"&typeid="&$E9&"&typeid="&$E10&"&usesystem=30002187","/evec_api/marketstat/type/sell/min")

Notice this usage of &$E5& etc., thats because I have a column on that spreadsheet that holds nothing but typeID for eve-central. You can hard code the values but this gave me better access to the data. This method produces a column full of data in a single go, so you can avoid hitting your formula limits.

You will see additional column entries created that look like this: =CONTINUE(C4, 2, 1)
thats good, its doing its job. You will occasionally be subject to lag issues or eve-central downtime as it may only show #Value instead...but if you just try again in an hour or two it will appear.

So by doing those 3 things thats as far as I have been able to push google docs. I'm currently exploring how to use php and google docs api and eve api to make user-friendly forms on a web site that allow data to be updated by users instead of sharing a bunch of spreadsheets...but thats tricky stuff...

Note: when using XPATH in the statments above (ie sum(//row[@typeid=37]/@quantity))...ALWAYS use lower-cased letters, for some reason google isn't compliant on XML standards here and entering the actual values may result in errors, but typing them in all as lower case solves it...sigh

Hope this helps someone!
Omega Flames
Caldari Provisions
Caldari State
#9 - 2012-03-07 08:05:16 UTC  |  Edited by: Omega Flames
You can easily link info from one sheet to another and even one spreadsheet to another spreadsheet. Inside the same document you can simply use a call like
Quote:
=sheet1!A1
to pull info from sheet1 cell A1 or
Quote:
=IMPORTRANGE("spreadsheet_key", "sheet1!C4:C19")
to pull info from one spreadsheet to another spreadsheet (the spreadsheet_key is found in the url of the spreadsheet you are querying from). https://support.google.com/docs/bin/static.py?hl=en&topic=25273&page=table.cs this can give you a list of all the possible functions for google spreadsheets. One important note is that if you are going to use an array in your formula's it's best to always add the ARRAYFORMULA function at the very beginning, I find that eliminates alot of possible errors.