Ok, so you have everything up and running, but want to update database, not just for you, but for everyone that uses EDDN data. How can you do this?
You have several options. You can use EliteOCR to scan snapshots of the market at each station, you can use something like ED Market Connector to use the EDAPI to full the information and save it to both EDDN, and to a CSV file for Trade Dangerous, Slopey's, Inara, Thrudd's and others. Or you can do what I do, use Trade Dangerous itself to pull the data and put it on EDDN.
Since this is the way I do it, I am adding instructions for it, just because it is not as simple as it sounds. If you want to use EliteOCR or ED Market Connector or similar, there are many threads on the main forums and reddit on how to use these programs. I am going to assume that you either want to use the Trade Dangerous Route, or have a way to get the Data already using EliterOCR or ED Market Connector already.
Data Format:Trade Dangerous has it's own data format which is not compatable to standard CSV files. They can be written by all the main programs and have an extension of .prices so you know they are different. This format is a little closer to XML format that CSV, so if you try a CSV file, its going to throw errors.
Getting the Data from EliteOCR:
If you are scanning your Commodity Market screen shots then you will see the buttons as shown below:
- EliteOCRExportButtons.JPG (18.06 KiB) Viewed 52906 times
You will notice that you can export for Trade Dangerous, Send to EDDN, Export to Slopeys BPC and regular CSV.
Thrudd's uses regular CSV as does Inara. Slopey's has it's own, as does Trade Dangerous. Sent to EDDN will just upload it to the EDDN site.
When you export to any of the File Formats, it will give it a name based on System, Station, Time.
For example: Apishna.Hamuy Port.2015-06-15T19.45.22.prices
Getting the Data from ED Market Connector:On the File menu in the program select settings and look at the options you see there as shown below:
- EDMarketConnectorExportSettings.JPG (20.56 KiB) Viewed 52906 times
As with EliteOCR, you have choices. You want to save as Trade Dangerous and send to EDDN as well.
What to do with the Price Files:At the bottom of the TD Helper program you will see the Import button. It has THREE functions depending on how you click it:
- Regular Click - Tryes to run Trade Dangerous's EDAPI Plugin (more on that further down this post).
- Shift-Click - Imports the last .prices file it had (Some programs will just name the export file "Trade Dangerous.prices" instead of by System/Station/Date/Time. If your chosen program saves the prices as the same name all the time, that is how you select it.
- Control Click - Allows you to select the Price file you want. (ED Market Connector and EliteOCR names the files by System/Station, so this is what you want to use)
So we Control Click, go select the file (First time you do this you will have to find the directory that you have told EliteOCR or ED Market Connector to save the files in, but after that it will open the same directory) and it will import. Easy.
But wait! Why are we updating both Local and EDDN? I though Trade Dangerous gets it's data from EDDN?Yes, Yes it does. But updates are only made every hour so that the changes at Maddavo's site can put them all together. Prices are on a 2 or 3 hour basis, and changes, corrections, and deletions, are all done in a batch. So YOU get the latest price for the station that you just imported, but others won't see it for 2-3 hours. You get a head start
Isn't there a quicker way?Why yes Virginia, there is a
Santa Clause a quicker way! We can use the built in EDAPI that Trade Dangerous has. Before I show you how, please note the following:
NOTICE: Trade Dangerous's EDAPI feature uses the same information that you can access in their iPhone app. This will require you to enter your Username and Password that is used on your Launcher, and therefore your Frontier Store Account. If you do not trust the program to NOT do nefarious things, then DON'T us this part, or Any Other app that wants your credentials.
Trade Dangerous is open source, and is a Python Script, so it is in plain text, not a Binary. Anyone can look at the source code, which is the same that you are running. It IS the source code. You can determine yourself if you have the knowledge what is happening with your account information.
I have looked at the source, others have as well, we all agree it is safe, and I feel no issues in using it. You have to make that determination for yourself.
Oh, and it is MUCH more accurate since it is getting the data direct from Frontier. No OCR Mistakes, or Typos. Accurate and FAST!
Now that we have all read that and want to continue, then here is how to proceed.
In order to use the EDAPI, Trade Dangerous has to log into the Frontier Web Service using YOUR account credentials. The first time this is done, Frontier will send you an Authorization code. This is protection to make sure that you are really asking to do this. You will then enter the code into Trade Dangerous, and it will create an encrypted cookie to use each time it fetches data. It will not need you to do this again unless something changes on Frontiers End, or on the Trade Dangerous end, or the cookie is deleted.
You cannot do this for the first time from TD Helper. You must do this from the Command Line.
First, open a command prompt and switch to the directory that you have installed Trade Dangerous. In this case, mine is C:\trade.
Next you want to Enter the following command:
Next you will be asked for your Username and Password, then it will prompt for the Authorization code that will arrive to your email. Enter it to continue, and then it will update for the current (or last docked at) station.
This is an example of exactly what you will see. NOTE: the password field will not show anything while typing in it. You can you copy paste.
Code: Select all
C:\trade>trade.py import --plug edapi
You do not appear to have any valid login cookies set. We will attempt
to log you in with your Frontier account, and cache your auth cookies
for future use. THIS WILL NOT STORE YOUR USER NAME AND PASSWORD.
Your auth cookies will be stored here:
C:\trade\data\edapi.cookies
It is advisable that you keep this file secret. It may be possible to
hijack your account with the information it contains.
If you are not comfortable with this, DO NOT USE THIS TOOL.
User Name (email):MyEmail@address.com
Password: (it will show nothing if you type or paste info here)
A verification code should have been sent to your email address.
Please provide that code (case sensitive!)
Code: 1Q3F5 (or whatever they send to your email)
@MUNSHIN/Sterny's Refuge (This is the station I am at currently)
<tradedb.Station object at 0x0000000005E5A800>
NOTE: Updated 5 ships in @MUNSHIN/Sterny's Refuge shipyard.
NOTE: Import complete: 44 updated items over 1 stations in 1 systems
You can see that it tells you where the cookie file is stored. If you delete that file, it will no longer work, and will no longer have access to your account info, as that is stored in the cookie.
You can also see that not only did it pull the Commodity Market data, but also what ships are in the shipyard. This is great if you are looking for a ship at a later date. It can save lots of time.
NOTE: There is a bug with the EDAPI. The ship data will NOT be pulled unless you have gone into the Shipyard at the station then hit exit. No way around it at this time. If you don't go into the shipyard then hit exit, it will only pull the Market Data.Now that we have set this up, how can we use it?
There are two ways: One is with TDHelper, and that is simply done by landing at a new station and clicking the Import Button. It does all the work, takes about 10-12 seconds, and it pulls the information into your local database and sends to EDDN.
However, there is another way, and that is on the Command Line. Now why would you want to do that when there is this nice button you ask? Well, let me tell you.
I have a batch file that I created in the Trade Dangerous folder. I called it "EDAPI Pull.bat" and it has only one line as you see below.
When run, it imports the station data with the ESAPI pluggin, then forwards it to EDDN. Simple.
But Why you ask? Because I am not always trading. I might be doing RES or CZ's. Maybe I am just out doing Bulletin Board missions. Every time I land, I can run the batch file, and get the data, and share it to EDDN. Its a win win.
Oh, did I mention that I use voice attack? Yep, so all I do in Voice Attack is say "Pull Data" and that command runs this batch file. I do it at every station. Part of my routine. So I help myself, and everyone else at the same time.
So that is why I use it, and how I use it. I hope that you will end up using it as well, but if not, at least you read a LOT of stuff I wrote and can point out mistakes
Conclusion:
Trade Dangerous has made me more money, in less time than any other tool I have used. Running TD Helper, and trade Dangerous uses less memory, and has less of a performance hit that using Chrome. I can update data to EDDN and my local database faster and with less mistakes that EliteOCR. And everyone benefits even when I am not trading because I can pull that data so easily.