| Author |
Thread Statistics | Show CCP posts - 0 post(s) |

Trayuni
Ministry of War Amarr Empire
0
|
Posted - 2013.01.17 13:24:00 -
[1] - Quote
I'm new to the API scene so sort of worming my way through it and learning as i go.
I want to return the number of assets I have in a particular station, veldspar for example. So far I have:
=ImportXML("https://api.eveonline.com/char/AssetList.xml.aspx?vcode=????&keyID=????&locationID=????", "sum(//row[@typeid=1230]/@quantity)")
It returns the correct item however it lists the total quantity, regardless of location. What am i doing wrong?  |

Trayuni
Ministry of War Amarr Empire
0
|
Posted - 2013.01.17 15:39:00 -
[2] - Quote
Thanks for the help TheSkeptic,
That's along the lines of what I am looking for. I was hoping to check the supply of an item across different characters. (again only in one station)
Pardon my ignorance, but I'm not familiar with creating my own database or xml code. This is something I hope to learn eventually. For now I'm merely looking for a quick fix to this single API query. I was hoping not to build anything large or complex.
TheSkeptic wrote:... try something like: sum(//row[@typeid=1230 and @locationID=1234567]/@quantity)
I tried working around this but couldn't get it to work. Again I'm terribly new to this sort of thing, i tried pasting it into the formula like so:
=ImportXML("https://api.eveonline.com/char/AssetList.xml.aspx?vcode=????&keyID=????&locationID=????", "sum(//row[@typeid=1230 and @locationID=1234567]/@quantity)")
This doesnt quite work. Any more suggestions? |

Trayuni
Ministry of War Amarr Empire
0
|
Posted - 2013.01.17 16:46:00 -
[3] - Quote
Many thanks for your continued help TheSkeptic. 
I've removed the locationID from the string as you mentioned. I'm starting to understand this change after a little more reading.
TheSkeptic wrote:...Out of curiosity what did you use for the locationID value?... I was using value of 60003304 for the only station in Adahum system (reference http://biotronics.basicaware.de/eve/download/StationID2Name.txt)
My fomula now stands at:
=ImportXML("https://api.eveonline.com/char/AssetList.xml.aspx?vcode=????&keyID=????", "sum(//row[@locationID=60003304]/rowset/row[@typeid=2395]/@quantity)")
I changed the type id to something I actually had in station (oops), however it still returns a value of 0. No error message though.
|

Trayuni
Ministry of War Amarr Empire
0
|
Posted - 2013.01.17 20:05:00 -
[4] - Quote
I dont really understand why but my eve wide total seems to work when i use this:
=ImportXML("https://api.eveonline.com/char/AssetList.xml.aspx?vcode=????&keyID=????", "sum(//row[@typeid=2395]/@quantity)")
This returns a correct result after a few different tests. I then used the following formula in hope for a station search:
=ImportXML("https://api.eveonline.com/char/AssetList.xml.aspx?vcode=????&keyID=????", "sum(//row[@locationid='60003304']/rowset/row[@typeid=''2395']/@quantity)")
This pulled an (incorrect) result of 0.
It's getting late for me so I will have to try again tomorrow after some more reading into the workings of xpath. Thanks again for your continued help TheSkeptic
PS. A little background on why I'm after this particular query. I'm setting up a small buying program between close friends. The idea is that i use their API to see if they have any Proteins for sale in station. If they do I send them a buy contract with however many I need at the time. At which point they can just hit accept on the contract. The query allows me to see if the person has enough available proteins(or whatever) for me to buy |

Trayuni
Ministry of War Amarr Empire
0
|
Posted - 2013.01.17 20:53:00 -
[5] - Quote
I guess that was a small typo when I was removing the API code for the forum. Top marks for attention to detail!
The formula on my sheet was entered correctly though. Still 0 result :(
|

Trayuni
Ministry of War Amarr Empire
1
|
Posted - 2013.01.18 02:02:00 -
[6] - Quote
Couldn't sleep much knowing I had this to test out after I read your reply on my phone. Tested it out and its working well :)
There was a delay in the query, when I first opened the sheet. Perhaps for reasons you expected. I left it a while and it was working after a coffee break.
For anyone interested here was the final solution to check assets in station.
=ImportXML("https://api.eveonline.com/char/AssetList.xml.aspx?vcode=____&keyID=____", "sum(//row[@locationid=____ and @typeid=____ ]/@quantity)")
I really appreciate the help TheSkeptic, left you a small donation ingame. |
| |
|