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.
12Next page
 

Market Cache data to MySQL

Author
6ie
The Kiwis
#1 - 2013-08-12 16:12:06 UTC
Is the easiest method Evemon -> localhost php runing yapeal -> MySQL DB?
(or is yapeal even needed?)

Or just setting up and scheduling Yapeal...

(newbie here) - advice appreciated.
Thanks!
Louis Vitton
Viziam
Amarr Empire
#2 - 2013-08-13 08:54:02 UTC
6ie wrote:
Is the easiest method Evemon -> localhost php runing yapeal -> MySQL DB?
(or is yapeal even needed?)

Or just setting up and scheduling Yapeal...

(newbie here) - advice appreciated.
Thanks!


what are you trying to archive? Market data caching but what exactly. I ask as the third party apps you have strung together here are not compatible and are not designed for what your after.
Elmore Jones
New Eden Mining Organisation
The Craftsmen
#3 - 2013-08-13 09:51:52 UTC
You have 2 options here, but not Yapeal as that is for API data not cache data.

First up is locally skimming the cache using Entitie's excellent Reverence library (google 'eve reverence' and d/l from github; see thread on these forums too).

Second is to setup a client to Eve Market Data Relay which takes your data uploaded by EveMon and all data similarly uploaded by others and scrape the market info you want from there.

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

Lumiere Noire
Last Line of Dudes
#4 - 2013-08-13 13:21:53 UTC  |  Edited by: Lumiere Noire
Elmore Jones wrote:
Second is to setup a client to Eve Market Data Relay which takes your data uploaded by EveMon and all data similarly uploaded by others and scrape the market info you want from there.

If you do this, be prepared to handle quite a lot of data. I used to store the raw compressed data from EMDR and it came to 150 to 200 megabytes an hour if I remember right. Also duplicates are quite common, especially in History data, so you need to filter that out before entering the new data into your database. Good luck!
Steve Ronuken
Fuzzwork Enterprises
Vote Steve Ronuken for CSM
#5 - 2013-08-13 14:21:48 UTC
If /all/ you want is a 5% average for buy and sell, for a few regions:

https://www.fuzzwork.co.uk/market/exports/sellprices.csv
https://www.fuzzwork.co.uk/market/exports/buyprices.csv

If you want history, you'll need to do more work.

Woo! CSM XI!

Fuzzwork Enterprises

Twitter: @fuzzysteve on Twitter

6ie
The Kiwis
#6 - 2013-08-13 16:20:23 UTC
Thanks for all the suggestions. I started setting up a connection to EMDR, but haven't complete it. I also was concerned the data might be considerable. I also was wondering how long it would be before I saw the data I submit to it (via Evemon).

I used to use EveOrg App (https://forums.eveonline.com/default.aspx?g=posts&t=28455) but it looks to be dead.
I run Javascript on the IGB and the EveOrg App would scrape the files, inserting the market data into a local MySQL DB.

Yes I would like history.

I see evemon has a built in scraper, and allows me to add an endpoint (http), which i figured I could run some PHP to grab the data and somehow get it into MySQL DB.

Or I could see how to get EVE Market Data Uploader (EMDU) to do the same.
(or Reverence)

I just figured someone had the same need (local cache files to a DB), and had set something up similar.

Any more suggestions are greatly appreciated.

Steve Ronuken
Fuzzwork Enterprises
Vote Steve Ronuken for CSM
#7 - 2013-08-13 18:28:32 UTC
What would you want to do to the market data? Store each order separately? update the data and just keep appending more records?

Woo! CSM XI!

Fuzzwork Enterprises

Twitter: @fuzzysteve on Twitter

6ie
The Kiwis
#8 - 2013-08-13 19:02:57 UTC
Yes, store each unique order separately. Update quantities & price if they change on a later scrape.

Run SQL to delete old orders once they are past expiry, or delete them if they do not show up in a later cache file.

I'll also want to keep item the daily item history summary (to determine what items have sold for in the past) for all locations.

I don't think I have the skills to do this upon data loading into the DB, but could probably run SQL to del old/unwanted data post import.
Steve Ronuken
Fuzzwork Enterprises
Vote Steve Ronuken for CSM
#9 - 2013-08-13 20:42:47 UTC
6ie
The Kiwis
#10 - 2013-08-13 22:08:42 UTC
Wow very nice, thank you. I'll go set it up and report back - thanks for the code, you went beyond what I was hoping for!
Steve Ronuken
Fuzzwork Enterprises
Vote Steve Ronuken for CSM
#11 - 2013-08-13 22:20:13 UTC
There is one 'bug' in the code.

It doesn't clean up orders which sell out.

You /may/ want to deal with that. Depends what you're doing with the data.

You could probably get away with running a delete for each match of region and typeid, as it's just you feeding the data in. It wouldn't scale well, but for a single source, it'd probably be fine.

Woo! CSM XI!

Fuzzwork Enterprises

Twitter: @fuzzysteve on Twitter

Steve Ronuken
Fuzzwork Enterprises
Vote Steve Ronuken for CSM
#12 - 2013-08-13 22:24:28 UTC
Lumiere Noire wrote:
Elmore Jones wrote:
Second is to setup a client to Eve Market Data Relay which takes your data uploaded by EveMon and all data similarly uploaded by others and scrape the market info you want from there.

If you do this, be prepared to handle quite a lot of data. I used to store the raw compressed data from EMDR and it came to 150 to 200 megabytes an hour if I remember right. Also duplicates are quite common, especially in History data, so you need to filter that out before entering the new data into your database. Good luck!



The data runs to around 350kb/s under normal conditions. That's compressed. (I run one of the relays. My outbound is higher as I have a bunch of subscribers to it.).

Exactly what you do with it is up to you. For my personal consumption, I throw away any data with a generated date older than the data that I have stored, which takes care of most of it.

Woo! CSM XI!

Fuzzwork Enterprises

Twitter: @fuzzysteve on Twitter

6ie
The Kiwis
#13 - 2013-08-14 00:45:17 UTC  |  Edited by: 6ie
Steve Ronuken wrote:
There is one 'bug' in the code.

It doesn't clean up orders which sell out.

You /may/ want to deal with that. Depends what you're doing with the data.

You could probably get away with running a delete for each match of region and typeid, as it's just you feeding the data in. It wouldn't scale well, but for a single source, it'd probably be fine.


Ok thanks, I'll look for that.

I have IIS running and a phpinfo.php page works, but when I access upload.php, it just prints the code - starting at: Attribute...

Evemon shows the same think in the log.

I have a schema 'test' in MySQL DB, the two tables you said think I have db.inc.php correct:
new PDO('mysql:host=localhost;dbname=test', 'root', 'pass);

Anything configured wrong? Did I need to install an OBDC connector? I see upload.php references evesupport.

EDIT: hmm upload.php looks incorrect... missing php tags & evesupport referenced.
Ok yeah that was it. Simple one.
Steve Ronuken
Fuzzwork Enterprises
Vote Steve Ronuken for CSM
#14 - 2013-08-14 00:59:44 UTC
you might want to replace the < ? with a < ?php

It works, but if short tags aren't on, < ? isn't enough.


If that doesn't work, what you can try is:

replace the

$parsed=json_decode($_POST['data'],true);

with the contents of:
http://pastebin.com/jVzx3HPq



Then if you browse to the page, it /should/ insert.

Woo! CSM XI!

Fuzzwork Enterprises

Twitter: @fuzzysteve on Twitter

6ie
The Kiwis
#15 - 2013-08-14 01:05:47 UTC
Yeah changing the < ? to < ? php and changing the evesupport reference seemed to fix it.
I have rows in the mysales table now :) Thanks alot!

Nothing in orderhistory. When will that populate?

Also, Evemon thinks the upload fails and suspends upload for some reason:
2013-08-13 20:55:38: Uploading to php is suspended until 8/13/2013 9:07:36 PM
2013-08-13 20:55:38: Uploading to php, orders: 39, typeID: 34 (Tritanium), region: 10000069 (Black Rise)
2013-08-13 20:55:38:
Next upload try to php at: 8/13/2013 9:10:38 PM
Steve Ronuken
Fuzzwork Enterprises
Vote Steve Ronuken for CSM
#16 - 2013-08-14 01:37:44 UTC
(oops. I meant to update the evesupport reference to a variable, to specify which database to stick it in)

umm.

Well, orderhistory only populates if you look at the item history. if you just look at the order details, you don't get it. so if you're running a market scan, do it twice, one with the orders, one with the history.

I'm not entirely sure why it thinks it's failing. It was loading fine for me.

For it to be seen as a success, it /has/ to return a 1. I don't think it cares about spaces, but it might. If it returns any other text, it will fail. If it doesn't return a 1, it will fail.

Woo! CSM XI!

Fuzzwork Enterprises

Twitter: @fuzzysteve on Twitter

6ie
The Kiwis
#17 - 2013-08-18 10:39:31 UTC
Steve Ronuken wrote:
There is one 'bug' in the code.

It doesn't clean up orders which sell out.

You /may/ want to deal with that. Depends what you're doing with the data.

You could probably get away with running a delete for each match of region and typeid, as it's just you feeding the data in. It wouldn't scale well, but for a single source, it'd probably be fine.


Ah yes I see orders in the mysales table, which no longer exist.
So for a specific typeid, the cache file contains all orders for the whole region?
(even ones not displayed in game (due to filters or range).
Steve Ronuken
Fuzzwork Enterprises
Vote Steve Ronuken for CSM
#18 - 2013-08-18 17:25:54 UTC
I believe so, yes.

Easier to do the filtering for that client side.

Simple to test for, anyway Blink

Woo! CSM XI!

Fuzzwork Enterprises

Twitter: @fuzzysteve on Twitter

Tuo Berahak
Contra Ratio
GameTheory
#19 - 2013-09-30 04:08:03 UTC
mytable in mysql doesnt populate eventhough evemon stated upload succesfull. am i doing it wrongly?
Steve Ronuken
Fuzzwork Enterprises
Vote Steve Ronuken for CSM
#20 - 2013-09-30 17:09:02 UTC
Tuo Berahak wrote:
mytable in mysql doesnt populate eventhough evemon stated upload succesfull. am i doing it wrongly?



Anything showing up in your apache error logs?

In the end, that's how you debug this kind of thing.

That, and adding error_log() statements to checkpoint the code.

Woo! CSM XI!

Fuzzwork Enterprises

Twitter: @fuzzysteve on Twitter

12Next page