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.
 

Coding logic question for eve-central queries

Author
Merckantos
#1 - 2012-06-19 10:38:44 UTC  |  Edited by: Merckantos
Hello,

I've started working on a small purpose app and I need to pull prices for items from eve-central (I like that they return XML structured data if you use their API).

The way I plan to do it is create the URL query string by going through a database, taking each item ID and creating the query URL string. First bump I hit was that the resulting string was waaay too long for XML query URL.
So I'm thinking of creating multiple query strings which are not going over the max URL string length limit and query them one at a time (though this puts quite some stress on the eve-central server when I run the prices update sub). Afterwards I take the XML data returned and store it in the database.

It's the first time I'm coding around databases & web queried XML data, and I'd like to hear opinions from more experienced people about my method. Should I use another approach? Could please point out to me a more optimal way for querying eve-central for prices on a large list of items?


Any help is much appreciated.
Thanks!
Muscaat
EVE Markets
#2 - 2012-06-19 10:46:27 UTC
This post might be useful to you - it's a fairly common question posed to Kaladr Smile

Sounds like your approach is at least superficially similar to mine. How often are you calling the EVE-Central API?
Merckantos
#3 - 2012-06-19 10:53:56 UTC
Well the prices updating will occur on direct user request. Since I'm storing them I will probably only wish to update my prices once a day maybe.
However if the query recommended limit is 20 requests, that means I will have to run quite some queries, since I plan to update prices on a wide range of items.
Although it seems weird that they would say 20 items, since I have an excel sheet which comfortably queries EVE_Central for 45-55 items at once.
suid0
Pandemic Horde Inc.
Pandemic Horde
#4 - 2012-06-19 13:05:24 UTC
It really depends how the app works and what it is going to do.

You could just treat the local version like a cache.

Fetch prices from eve-central only when they are required and either don't already exist in the local cache or have expired.

the entire enemy support fleet is dead except for one interdictor a titan could easily finish off with drones  - Commander Ted

Merckantos
#5 - 2012-06-19 14:28:05 UTC
Yes.
I was thinking to switch to the model where I only query the prices I need for current calculation and also store the prices fetched. Next time I run calculations on the same item, just check if the prices are old and need to be updated.