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 - Remotely monitor POS Fuel with Google Docs Spreadsheet (Help Needed)

Author
Yukie Valentine
School of Applied Knowledge
Caldari State
#1 - 2013-11-08 11:06:53 UTC
Hey there, I'm going to use Google Docs to make a spreadsheet for remotly monitoring my POS Fuel in a control tower, but i'm not very good with XML.
I can't seem to get the right argument for pulling the quantity value from the generated XML file, if anyone could help me it would be greatly appreciated.

I will not display any corperation information but this is how the XML is structured:
http://dl.dropboxusercontent.com/u/57287908/EvE%20Online/StarbaseDetail.txt

The values i'm looking to extract is the quantity of:
https://dl.dropboxusercontent.com/u/57287908/EvE%20Online/Quantity.txt


What would i have to add to this string to make it work properly? it can be one seperate line per value if it's not possible to grab both of them at the same time.

=ImportXML("http://api.eveonline.com/corp/StarbaseDetail.xml.aspx?keyID=xxxx&vCode=xxxxxxxx&itemID=xxxxxxxxx

Once i've gotten this to work i will share the spreadsheet with anyone who wants to use it aswell, but you will have to specify your own API key obviously.

Thanks in advance.

// Yukie Valentine
Steve Ronuken
Fuzzwork Enterprises
Vote Steve Ronuken for CSM
#2 - 2013-11-08 12:57:33 UTC  |  Edited by: Steve Ronuken
Welcome to the wonderful world of xpath.

try:

=ImportXML("https://www.fuzzwork.co.uk/temp.xml","//row[@typeid=4247]/@quantity")
=ImportXML("https://www.fuzzwork.co.uk/temp.xml","//row[@typeid=16275]/@quantity")


I rehosted your file, as you're missing the last >, which breaks it as xml.

You could leave out the [@typeid] bit, but using it makes sure you get the values properly, regardless of the order they're in the xml.



Xpath is normally case sensitive. But google, in their infinite wisdom, decided to lowercase all the keys.

Woo! CSM XI!

Fuzzwork Enterprises

Twitter: @fuzzysteve on Twitter

Yukie Valentine
School of Applied Knowledge
Caldari State
#3 - 2013-11-08 14:09:41 UTC
Steve Ronuken wrote:
Welcome to the wonderful world of xpath.

try:

=ImportXML("https://www.fuzzwork.co.uk/temp.xml","//row[@typeid=4247]/@quantity")
=ImportXML("https://www.fuzzwork.co.uk/temp.xml","//row[@typeid=16275]/@quantity")


I rehosted your file, as you're missing the last >, which breaks it as xml.

You could leave out the [@typeid] bit, but using it makes sure you get the values properly, regardless of the order they're in the xml.



Xpath is normally case sensitive. But google, in their infinite wisdom, decided to lowercase all the keys.

Thanks!, this will help me alot.

I have to say i didn't expect you to be the one responding to my question, i really like your site and has been using it for months now, keep up the good work!
Yukie Valentine
School of Applied Knowledge
Caldari State
#4 - 2013-11-08 15:26:07 UTC
As promised here is the Spreadsheet if anyone else want to use or get ideas for the same application.

Version 1: https://docs.google.com/spreadsheet/ccc?key=0Al3JU_2wW6JgdHhFajgza3FNVzJIQkZpZmwxOGVkSGc&usp=sharing

To make it work you will have to enter your own API key and Control Tower ID, which is represented as "itemID="

=ImportXML("http://api.eveonline.com/corp/StarbaseDetail.xml.aspx?keyID=xxxx&vCode=xxxxxxxx&itemID=xxxxxxxx&","//row[@typeid=xxxx]/@quantity")

Inorder to find the ID for your tower you will have to check your StarbaseList API here, again entering your API key.
https://api.eveonline.com/corp/StarbaseList.xml.aspx?keyID=xxxx&vCode=xxxxxxxx

Now depending on which control tower you use you will have to enter the right ID in "[@typeid=xxxx]" i will post them below.

Amarr Fuel Block: 4247
Caldari Fuel Block: 4051
Gallente Fuel Block: 4312
Minmatar Fuel Block: 4246

If you POS is located in taxed space you might want to be able to monitor your Starbase Charters. To do this you simply make a new column with the same string as before, but instead of adding the Fuel Block ID you add the Starbase Charter instead.
I'll list them below.


Amarr Empire Starbase Charter: 24592
Caldari State Starbase Charter: 24593
Gallente Federation Starbase Charter: 24594
Minmatar Republic Starbase Charter: 24595
Khanid Kingdom Starbase Charter: 24596
Ammatar Mandate Starbase Charter: 24597

The same goes for Strontium Clathrates..

Strontium Clathrates: 16275


I hope this will help someone else aswell, this first spreadsheet is just a quick mockup.
I will update when i've made a new version after i've had some time to "perfect" it for myself.

This is how it looks when working correctly:
https://dl.dropboxusercontent.com/u/57287908/EvE%20Online/POS%20Fuel.png

Thanks again to Steve Ronuken for helping me out.

// Yukie Valentine