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.
 

Yapeal PHP API library (2.0)

Author
Dragonaire
Here there be Dragons
#141 - 2014-09-11 15:50:45 UTC
For those that may have been waiting for it corp/CorporationSheet is now finished and been pushed out. It can be used to get public corporation information by just using corporationID with oneShot() . Note that that API does have a quirk in that if you include a corporationID argument when requesting the XML you end up with just the public info vs if you just have the keyID and vCode you get the full info. Why? I have no idea really you can ask CCP on that one Blink

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

Tiberius Zol
Moira.
#142 - 2014-09-12 11:56:49 UTC
Have a problem with the CorporationSheet stuff.
I have 2 corp API keys in my table (1 CEO, 1 Director) For the director key i get this in my log:

Quote:

[2014-09-12 12:37:41] yapeal.DEBUG: Started network retrieve for corp/CorporationSheet [] []
[2014-09-12 12:37:41] yapeal.DEBUG: Started XSD validating [] []
[2014-09-12 12:37:41] yapeal.DEBUG: Element 'allianceName': This element is not expected. Expected is one of ( factionName, taxRate ). [] []
[2014-09-12 12:37:41] yapeal.WARNING: The data retrieved from Eve API corp/CorporationSheet for 98067338 is invalid [] []


I also found no xml file for it.

Mr. Tibbers on twitter: @Mr_Tibbers

Mr. Tibbers Blog: www.eve-versum.de

Dragonaire
Here there be Dragons
#143 - 2014-09-12 15:24:16 UTC
Since it thinks it's invalid look for an InvalidCorporationSheet*.xml file but I'm thinking you got one of the WIP version of CorporationSheet.xsd that might have slipped out and not the final one so you probably should update Yapeal again to the current version and insure everything is correct. There should be a line in the XSD that looks something like this

xs:element type="eveNameType" name="allianceName" minOccurs="0"
maxOccurs="1"

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

Tiberius Zol
Moira.
#144 - 2014-09-12 18:50:19 UTC
Hey.. had pulled all new stuff before..deleted cache..and so on... so that was the latest version.. checked that for sure.. it is really the latest..
have checked the xsd and found your line..
have checked the cache also.. and found the InvalidCorporationSheet

so seem to be another problem..

here the part from the xml (deleted the < and > only, forum don't allow html stuff):

Quote:

url http://www.turaagaq.de /url
allianceID 99003170 /allianceID
factionID 0 /factionID
allianceName GANOR INC. /allianceName
taxRate 2.5 /taxRate

Mr. Tibbers on twitter: @Mr_Tibbers

Mr. Tibbers Blog: www.eve-versum.de

Dragonaire
Here there be Dragons
#145 - 2014-09-12 19:15:03 UTC  |  Edited by: Dragonaire
So looks like what is causing the problem is CCP decided to put the allianceName after the factionID instead with allianceID P I'll look at making it either not care or update the order. You can try just moving the line in the XSD yourself and see if it fixes it for you.

https://github.com/Dragonrun1/yapeal/issues/55 CorporationSheet fails XSD verifying on allianceName resolved.

Try the update it should fix the issue on this and any other out of order elements.

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

Elojs
White Cottage Holdings
#146 - 2014-09-14 12:28:04 UTC
Dragonaire wrote:
Base way as an application programmer is to look at it is you have a database that just magically always has the most up to date data possible. You are right in that to make that happen you do need to have Yapeal running in a crontab which is outlined in one of the Wiki pages. I don't have direct instructions for Windows because you usually do it through the GUI which is much harder to explain without a lot of screen shots etc. Also each version of Windows is a little different and I'm not going to take the time to try figuring it out with each of them. Most people will use Yapeal on a Linux server anyway so I don't expect that to be much of a problem since they have crontab.

As to how often Yapeal should run in the background I'm always very clear about that. Yapeal should run every single minute to insure the lowest server load on both ends and the most up to date data. Yapeal internally manages which APIs are ready for refreshing from the Eve API servers and trying to second guess it on that just causes you more load and problems NOT less like everybody seems to think.

How to use Yapeal for things like site signup etc does take a little more work but not much as I made a utility class you can use to add the API key info into the right table which you can find in bin/UtilRegisterKey.php. After that or possibly before you can also use any of the API classes you'll find in lib/Database/*/ directories directly just like the main Yapeal class does or even just extend from it. You'll find it in lib/Yapeal.php. You can just ignore the AutoMagic() method or override it to do what you need. The code is the best documents you will ever find in any project on how something works so don't be afraid to poke around in it a little. Blink

Just an additional hint for things like signups etc is to use the oneShot() method in the lib/Database/Account/APIKeyInfo class. It'll put the EVE API result info into the account database tables where you can check the mask and get the character and corp info you might need.

Hope this helps you get going or at least gives you some idea where to find out some more about some of the stuff. Remember the database is the interface everything else is just setup to make it work Big smile


I've yet to try Yapeal in a Linux box. All my play with it has been in Windows, XP, 7 (32 and 64 bit), all Professional versions.

The simplest way is to build a .BAT or .CMD file (a batch file) that executes Yapeal and updates the database with no human intervention needed. From there, using Task Scheduler, set up a background task to execute every minute for a server with multiple accounts, or every 15 minutes or so for a personal use setup, which is what I use for my multiple accounts with multiple characters, and a couple of corps as well.

Fly safe,
Paul
Dragonaire
Here there be Dragons
#147 - 2014-09-14 19:24:38 UTC
I've been known to just add Yapeal directly into the task scheduler on Windows a few times but a BAT file can make it a little easier. Just a little tip for Windows users in the trigger advanced settings under Repeat task every: you can edit the number so instead on the lowest being 5 minutes you can change it to 1 Blink The list is just suggested values not the only ones allowed.

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

Tesla Ming Chent-Shi
Anoikis Exploration and Prospecting
#148 - 2014-09-22 22:31:55 UTC
So far working with your API has been great.

I seem at a loss to find where the corp members or members total is located. Which table are the corp members or members total located in?
Dragonaire
Here there be Dragons
#149 - 2014-09-23 15:41:19 UTC  |  Edited by: Dragonaire
Tesla Ming Chent-Shi - If you are looking for a list of the characters in a corporation that's the MemberTracking API and you'll find a table by that name as well. If you just want to know the number of people in the corporation is you can find that in the CorporationSheet if you have at least a limited key. You might want to take a look at https://neweden-dev.com/API to learn more about the actual available APIs. For APIs that have multiple rowsets or rowset like parts you'll find the data broke out into another table with the same name for example the logo part from the CorporationSheet API becomes the corpLogo table.

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

Tesla Ming Chent-Shi
Anoikis Exploration and Prospecting
#150 - 2014-09-23 19:53:11 UTC
Thanks - I had found that table, but its always empty. I have a few corps which are letting me use them as guinie pigs, yet that table is always empty.

What am I missing with this? Are the above-stated problems related to this issue? Do I need to upgrade Yapeal?

Thanks for your time. I'll post the finished product of my site when its done :D
Dragonaire
Here there be Dragons
#151 - 2014-09-23 21:08:29 UTC
Make sure the corp keys you have include MemberTracking in their mask. There are a couple of bits in the mask that control this API. One doesn't include as much details about the members location etc as the other which you can read more about on the MemberTracking API page from the above link. Some corporation are a bit touchy about including the more complete location Info I know or even the lesser API because it does give a lot more detail than their member might want available about their location even with the longish cache time used.

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

Tesla Ming Chent-Shi
Anoikis Exploration and Prospecting
#152 - 2014-09-23 22:16:17 UTC
I might follow - I thought the table "corpCorporationSheet" contained only the generic publicly available info.

Do I need the special permission you speak of for this table? Otherwise, what else could stop this table from populating?
Dragonaire
Here there be Dragons
#153 - 2014-09-24 04:17:29 UTC
Corporation member information isn't in CorporationSheet just the memberCount and memberLimit info is available from that API. To get the info about the actual members in the corp you need to use MemberTracking. I did push out some updates to Yapeal to fix an issue with the ceoName column as well today that I had forgotten to push out plus the other fixes to FactionName etc that Tiberius Zol found which could be causing you the same issue in CorporationSheet.

You should always make sure to update any time I put out updates to tables/APIs you are using since sometimes there can be additional small fixes that don't make it into the commit messages for things I notice while fixing the main issue I'm working on. I have been trying to always create a new issue for those things with its own commit but a lot of times I'll not do so when the fixes are inter-related and/or its only a couple of lines of code. A good example of something I usually don't include in the commit message since I decided to make Yapeal require PHP 5.4 is that as I make any changes in any of the PHP files in Yapeal I'm updating all of the arrays to use short syntax. Since this really doesn't effect how it works I don't usually feel that it needs to be included in the commit message. There can be other minor things like this as well from time to time that I don't expect to effect how Yapeal works.

I was a little unclear from your post if you were saying you CorporationSheet tables were empty or just the MemberTracking table which is a different API. Either way hopeful the above answered your question Blink If not maybe you can try explain in a bit more detail what info your need and where you are looking for it so someone can help direct you to it.

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

Tesla Ming Chent-Shi
Anoikis Exploration and Prospecting
#154 - 2014-09-24 05:53:45 UTC
Thanks for the reply. I'm not always good at explaining my issues Ugh

The issue is simply that the CorporationSheet table is empty. I see the columns in that table would be quite useful, yet they don't seem to populate.

The Member tracking table does populate, depending on access permissions.

So simply stated, the only issue I'm having is the corporation sheet table remaining empty. Other than that, perfection Big smile

Here you can see what I am working on:

http://www.evecorps.co/

On this page you can see how the CorporationSheet will come in handy, allowing me to pre-fill a lot of corp info to the right of the corp icon:

http://blazn-dragunz.evecorps.co/
Dragonaire
Here there be Dragons
#155 - 2014-09-25 23:53:06 UTC
So I put out a few updates to Yapeal and I wanted to briefly go over them a little.

The first one is the new User-Agent header stuff. If you don't know anything about what the User-Agent header is you can read about it at http://en.wikipedia.org/wiki/User_agent. In the past Yapeal kind of allowed for a custom setting but it was added and implemented in a way that made it hard to use and as best I can tell never really was. I'm hoping that with the better design I used this time that everyone will find it easier and it will get used more this time around. Have a look at the config/yapeal-example.yaml for more info on the settings and let me know if anything is still unclear.

The other new thing is the stuff to do with corporationSheet and using corporationIDs found in some of the other APIs. The CorporationSheet API allows you to get the same public information that available in game using just the corporationID argument. There are now a couple of new API classes I added to take advantage of the corp info available in a couple of the existing APIs.

The first one is account/YapealCorporationSheet.php and uses the info from the accountCharacters table. To avoid conflicts with any exist corporation keys that might have the CorporationSheet API active they are filtered out so the less complete public info doesn't overwrite the detailed info from the regular API. This one is active by default as it adds little load and most apps should find the addition info useful.

The other new class/API is eve/YapealCorporationSheet.php. It uses corp info from the eveMemberCorporation table which is part of the eve/AllianceList API. This one is still considered experimental and is NOT active by default. On average in Eve there are ~13k corps in some kind of alliance and getting even just the public information on them adds a lot of load to Yapeal and the Eve API servers. I made the cache interval a day long as that should be often enough since corps are limited on how quickly they can leave and join alliances. Note that at this time the corp IDs are not filtered like with the other API so more detailed info can end up being overwritten but I plan on fixing that in the future. Note that during testing it's been taking up to 1.5 hours to run this API. I believe why it's taking so long for me is do to the high latency I have since I'm on the West Coast in the States and the servers are a 1/3 of the way around the world from me. It would be nice if someone in Europe which should have less latency would try it for me so I'll know for sure if that's really the issue I've been having. Anyway as I said this one is experimental still and I'd like to get some feedback on how it's working from people before I make any additional changes.

As always thank you for use Yapeal, Dragonaire.

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

Dragonaire
Here there be Dragons
#156 - 2014-09-25 23:56:12 UTC
Tesla Ming Chent-Shi - I just notice the forums eat my reply to you it seems P Have a look at post 142 above as it's about the same API and has info on what to look for.

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

Dragonaire
Here there be Dragons
#157 - 2014-09-28 02:48:29 UTC
So added SkillInTraining API for anyone that uses it instead of the SkillQueue API. I'd like to thank Icy0ne for his work on it. It's actual very rare to have someone add code to Yapeal other than myself so it does mean a lot to me that someone took the time to do so. Also his work on a couple of the other APIs in his branch lead to me fixing a couple of the issues I've pushed out over the last couple of days.

As always thank you for using Yapeal, Dragonaire.

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

Dragonaire
Here there be Dragons
#158 - 2014-09-30 08:49:05 UTC
HI all thought I'd let you know I've update the 'yc D:I' and 'yc D:U' commands. Probably the most noticeable change will be they now are better integrated with the rest of Yapeal and can be ran from directories other than the base directory. So where before you couldn't run them from the 'bin/' directory you can now.

The other thing I did while I was working on them is made them a little smarter so now some of the stuff that use to be in the SQL files can be removed. I updated the existing SQL files but no updating is needed to the tables etc.

The next time you run the 'yc D:U' command you should notice it being a bit faster as it no longer is adding and dropping the procedure over and over again for each file. This will probably be more noticeable when there are multiple update files to bring your database current.

As always thank you for using Yapeal, Dragonaire.

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

Dragonaire
Here there be Dragons
#159 - 2014-10-02 14:38:50 UTC
Okay like to thank Xinryu for noticing and working with me while I figured out an issue with the corp/WalletJournal and Transactions. Seems it wouldn't update the cachedUntil date-time for non-faction warfare corporations and I'd never noticed it P
https://github.com/Dragonrun1/yapeal/issues/63

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

Dragonaire
Here there be Dragons
#160 - 2014-10-09 20:10:40 UTC
Ok I pushed out a couple fixes today for everyone. First one for char/ContactNotifications which was mostly typos that QA (me) missed Oops The other was on the new char/SkillInTraining where Yapeal was modifying the cached XML in a way that made it invalid when it tried to get it from the filesystem.

Be aware there are some changes coming to char/CharacterSheet which will mean Yapeal will probably be broken until you update after its deployed. An update is in the works and I should have it deployed on the same day when it goes live on TQ. I'd deploy it sooner but since the changes are NOT going to be backwards compatible they have to wait. For anyone that missed the thread about the changes check out https://forums.eveonline.com/default.aspx?g=posts&t=378333&find=unread

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.