Pages: [1] :: one page |
|
Author |
Thread Statistics | Show CCP posts - 0 post(s) |

Dustey Roads
Crash Code
0
|
Posted - 2013.11.04 22:16:00 -
[1] - Quote
Hi guys,
I am a complete novice at coding and have been having a nightmare of a time trying to pull data for a specific division of my corp wallet using php and xml. I thought I had got to grips with what I needed to do, but every time I try to pull the data I either end up with an error or a blank screen.
I hate to ask, but as I am a complete noob, could somebody link me to or send me the complete php code I need to use?
Thanks for your time. |

Princess Honneamise
Blood And Sand Against ALL Anomalies
0
|
Posted - 2013.11.04 23:46:00 -
[2] - Quote
it is all the day im working on a emdr client in C, so my brain is smoking...
btw according to this : http://wiki.eve-id.net/APIv2_Char_JournalEntries_XML
you should setup a request like :
Quote:$keyID="your key"; $vcode="your vcode"; $characterID="your charatcer id"; $accountKey="division you want"; $url = "http://api.eveonline.com/char/WalletJournal.xml.aspx?keyID=".$keyID."&vcode=".$vcode."&characterID=".$characterID."&accountKey=".$accountKey.""; $xml = file_get_contents($url); if($xml===FALSE){print("Unable to get the file, http://api.eve-online.com down ?\n"); exit;}; $file = simplexml_load_string($xml); $qt=count($file->result->rowset[0]); if($qt==0){print("empty rowset\n"); exit;}; foreach ($file->result->rowset[0] as $value) { print($value); }; |

Steve Ronuken
Fuzzwork Enterprises Vote Steve Ronuken for CSM
1979
|
Posted - 2013.11.05 01:39:00 -
[3] - Quote
The short answer is: you can't pull a single division.
The longer answer is: you have to pull the entire thing, then filter it down.
The even longer answer involving code will have to wait for tomorrow, when I'll have a poke at it.
I'm assuming you're wanting to look at the wallet journal or wallet transactions for the corp, rather than just the balance? |

Louis Vitton
3-Strikes Nulli Secunda
51
|
Posted - 2013.11.05 07:50:00 -
[4] - Quote
If your a novice, use Phealng https://github.com/3rdpartyeve/phealng It has a nice to array function to assist with getting the parts you need. It is a php libary |

Princess Honneamise
Blood And Sand Against ALL Anomalies
0
|
Posted - 2013.11.05 10:08:00 -
[5] - Quote
Steve Ronuken wrote:The short answer is: you can't pull a single division.
The longer answer is: you have to pull the entire thing, then filter it down.
The even longer answer involving code will have to wait for tomorrow, when I'll have a poke at it.
I'm assuming you're wanting to look at the wallet journal or wallet transactions for the corp, rather than just the balance?
dont you can pull "/corp/WalletJournal.xml.aspx " adding the accountKey parameter ?
Quote: It isn't necessary to specify accountKey for characters because they have only one wallet (accountKey=1000). However, corporations have seven wallets with accountKey(s) numbered 1000 through 1006. Use /corp/AccountBalance.xml.aspx to determine which accountKey corresponds to each corporate wallet.
|

Steve Ronuken
Fuzzwork Enterprises Vote Steve Ronuken for CSM
1979
|
Posted - 2013.11.05 10:30:00 -
[6] - Quote
Princess Honneamise wrote:Steve Ronuken wrote:The short answer is: you can't pull a single division.
The longer answer is: you have to pull the entire thing, then filter it down.
The even longer answer involving code will have to wait for tomorrow, when I'll have a poke at it.
I'm assuming you're wanting to look at the wallet journal or wallet transactions for the corp, rather than just the balance? dont you can pull "/corp/WalletJournal.xml.aspx " adding the accountKey parameter ? Quote: It isn't necessary to specify accountKey for characters because they have only one wallet (accountKey=1000). However, corporations have seven wallets with accountKey(s) numbered 1000 through 1006. Use /corp/AccountBalance.xml.aspx to determine which accountKey corresponds to each corporate wallet.
Bah. Time to update the evelopedia documentation for the corp api. which completely skips the account key parameter.
Ignore my earlier post.
And use phealng. it makes life a lot easier :)
If you want to avoid having to install the library: https://gist.github.com/fuzzysteve/7317000 |

Princess Honneamise
Blood And Sand Against ALL Anomalies
0
|
Posted - 2013.11.05 10:38:00 -
[7] - Quote
i have just tested it and it works :P so for the first guy who asked , if you need to grab the wallet journal of a specific division you can use :
Quote: $keyID="your key"; $vcode="your vcode"; $characterID="your charatcer id"; $accountKey="1000"; //the division you want
$url = "http://api.eveonline.com/corp/WalletJournal.xml.aspx?keyID=".$keyID."&vcode=".$vcode."&characterID=".$characterID."&accountKey=".$accountKey."";
$file = file_get_contents($url);
print($file);
//now play in xml with $file
As before the apikey must be of type corporation. |

Dustey Roads
Crash Code Greater Western Co-Prosperity Sphere
0
|
Posted - 2013.11.05 19:06:00 -
[8] - Quote
Hi guys,
Thanks very much for your responses. No, I don't need to see the transactions. Basically, one of my corps, including the POS' and wars are run from donations and I just wanted a simple way to show how much had been donated to a specific division ready for the following months antics.
I will have a look at phealing but already tried the stuff from the wiki before realising it was out of date. I did find some documentation that was up to date, but was unable to get the information to display in the browser. |

Dustey Roads
Crash Code Greater Western Co-Prosperity Sphere
0
|
Posted - 2013.11.05 19:37:00 -
[9] - Quote
Ok guys, with your help I made some progress. The file is now displaying the date and time of the api pull when the contents are fetched and printed, but the balance still doesn't show.
Here is what I changed: I stopped using the wallet call and am now using CorporationAccountBalance I also stopped using concatenated variables and just put in the required url and printed it. The code now looks something like this:
Quote:$url = "http://api.eveonline.com/corp/AccountBalance.xml.aspx?keyID=myKeyID&vcode=myVCode&accountKey=1001";
$file = file_get_contents($url);
print($file);
Is there something I am missing which is stopping the balance from displaying? |

Steve Ronuken
Fuzzwork Enterprises Vote Steve Ronuken for CSM
1980
|
Posted - 2013.11.05 20:06:00 -
[10] - Quote
You may or may not have all the php modules you need, built in.
It can be a problem.
What to try:
Go to the URL yourself, and you should get some XML. try putting that into the php directly (use http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.nowdoc to quote it) and processing it. |
|

Jade III
Angry Mustellid
97
|
Posted - 2013.11.05 20:27:00 -
[11] - Quote
How do you make the information from the xml file actually show on the webpage? |

Dustey Roads
Crash Code Greater Western Co-Prosperity Sphere
0
|
Posted - 2013.11.05 20:53:00 -
[12] - Quote
Jade III wrote:How do you make the information from the xml file actually show on the webpage?
I have tried print and echo but neither work. |

Princess Honneamise
Blood And Sand Against ALL Anomalies
0
|
Posted - 2013.11.05 21:58:00 -
[13] - Quote
according to dustey it seems some problem persist about balance updating. for your info the code used now is :
Quote:
$keyID="---"; $vcode="---"; $characterID="---";
$url = "http://api.eveonline.com/corp/AccountBalance.xml.aspx?keyID=".$keyID."&vcode=".$vcode."&characterID=".$characterID."";
$file= file_get_contents($url);
$xml = simplexml_load_string($file);
print("please refresh after :".$xml->cachedUntil." ( eve time)\n");
foreach ($xml->result->rowset[0] as $value) {
print($value['accountID']); print(" --- "); print($value['accountKey']); print(" --- "); print($value['balance']); print("\n");
};//close loop
|

Dustey Roads
Crash Code Greater Western Co-Prosperity Sphere
0
|
Posted - 2013.11.05 22:01:00 -
[14] - Quote
Thanks again for all the help.
Still waiting to see if the balance updates once a donation has been made after the API call refreshes, but the information is now printing to the screen as it should. |

Dustey Roads
Crash Code Greater Western Co-Prosperity Sphere
0
|
Posted - 2013.11.05 22:11:00 -
[15] - Quote
So even with a donation to the corp wallet and a refresh timer, the balance shown by the xml fetched is still wrong which is a little peculiar. |

Peter Powers
Terrorists of Dimensions Free 2 Play
171
|
Posted - 2013.11.06 10:22:00 -
[16] - Quote
Dustey Roads wrote:So even with a donation to the corp wallet and a refresh timer, the balance shown by the xml fetched is still wrong which is a little peculiar. can you be a bit more detailed on how it is wrong? |
|
|
|
Pages: [1] :: one page |
First page | Previous page | Next page | Last page |