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.
 

PHP + API. Few questions

Author
Lieutenant Kiff
Imperial Shipment
#1 - 2011-09-26 14:09:24 UTC  |  Edited by: Lieutenant Kiff
Well right now I am looking at a one of the libraries but Im not sure exactly how I am going to use it for my needs so I am looking to see if I can even fully accomplish what I am looking to do.

Pretty much I am coding a login system for a project of mine but I want to by default fill 3 of the fields I ask for using the API.

Username (Ingame Name)
Corporation
Alliance

Those 3 fields I want to use API to put in the MySQL DB table using limited API on my register page.

So could anyone point me in the right direction or have any tips to pulling those 3 things with PHP?
Steve Ronuken
Fuzzwork Enterprises
Vote Steve Ronuken for CSM
#2 - 2011-09-26 15:07:04 UTC

http://wiki.eveonline.com/en/wiki/EVE_API_Account_Characters
has most of what you want. Just not the alliance info.

http://wiki.eveonline.com/en/wiki/EVE_API_EVE_Character_Info
Has the alliance info, but you'll need to hit the first, to get the character id, as an api doesn't limit to it. (If you're using the IGB, you could cheat and use the header to get the char id)




While it's not directly relevant, the php below is an example of how to parse info from the API
Quote:

< ?php

$data = file_get_contents('https://api.eveonline.com/eve/CharacterInfo.xml.aspx?characterID=90926985');
$xml = new SimpleXMLElement($data);
#var_dump($xml);


print $xml->result->{'characterName'}->{0};


? >




Another option you have is http://wiki.eveonline.com/en/wiki/IGB_Headers
This would require people to come in via the IGB, but it would allow you to bypass needing an API key (though it's not trustworthy. An evil git like myself could fake it all). If you're only using it for prepopulation, then:

Quote:

< ?php
$name=$_SERVER['HTTP_EVE_CHARNAME'];
$corp=$_SERVER['HTTP_EVE_CORPNAME'];
$alliance=$_SERVER['HTTP_EVE_ALLIANCENAME'];
? >





Bear in mind that these days, the limited API is going away. You'll need people to create a specific API key for use here, with specific privs. I believe all you'll need is the public character information.

Woo! CSM XI!

Fuzzwork Enterprises

Twitter: @fuzzysteve on Twitter

Lieutenant Kiff
Imperial Shipment
#3 - 2011-09-26 15:15:18 UTC
I wasnt really even thinking about the headers..... But yes the headers seem like it would be the simplest way and I was intending for use with the IGB primarly... However as for faking it that would just defeat the purpose of using what I am making which I dont want to throw about publicly right now. So I think I may go with the IGB headers for now and possibly switch over later...
Johnathan Roark
Quantum Industries
#4 - 2011-09-29 04:23:23 UTC
Do not use headers! They are very easily spoofed, would take me about a minute to do so.

For this, I suggest using pheal. It has the examples your looking for in the documentation.

EVEVERIFY - A recruiting API Verification and Audit Tool

Also try out Yapeal for your php api needs

TorTorden
Tors shibari party
No Holes Barred
#5 - 2011-09-29 12:01:00 UTC  |  Edited by: TorTorden
Im using apikeyinfo that gives charname,corp,charid
I also keep alliance list stored in the db. Fetches a list of corporations and pumps into an array if he/she is a member of one of them then good, else they can take a hike.