The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

WebService::EveOnline -- a wrapper intended to (eventually) provide a consistent interface to the MMORPG game, "Eve Online"

(N.B. Export EVE_USER_ID and EVE_API_KEY to your environment before installing to run all tests.)

Running under MS Windows will not work without tweaking. Support for non-unix architectures is intended to follow at a later date. Please consider this module's status as EXPERIMENTAL.

VERSION

0.01 -- This is an incomplete implementation of the Eve Online API, but is a starting point.

SYNOPSIS

use WebService::EveOnline;

my $eve = WebService::EveOnline->new({
	user_id => <user_id>,
	api_key => '<api_key>'
});

my $character = $eve->character->name('<character_name>');

print $character->training->{name} . " will finish training at " .
 $character->training->{training_end} . "\n";

DESCRIPTION

WebService::EveOnline (essentially) presents a nice programatic sugar over the top of the pretty cronky API that CCP games provide. The idea is that an interested party (e.g. me) can keep track of what's going on with my characters in a similar manner to what EveMON does.

There is currently no item data provided with this interface (although the API exposes no item data anyway, it'd be nice to have at some point).

Also, no map or wallet information is supported although this will be added as a priority over the coming weeks.

Initialising

WebService::EveOnline is instantiated with a 'standard' (so much as these things are) call to "new". Usually, at this point you would pass down a hashref that contained the keys "user_id" and "api_key" as demonstrated in the synopsis.

You MUST specify your user_id and api_key parameters in order to get the API to work, even if you're only interested in returning data where they are not normally required by the API.

You may also specify the following parameters:

cache_type: Defaults to 'SQLite'. For now, please keep the default. cache_dbname: Database to use to store cached skill data. cache_user: Username of the database to use. Do not use yet. cache_pass: Password of the database to use. Do not use yet. cache_init: Set this to 'no' to disable caching. Not recommended. cache_maxage: Maximum time (in seconds) to wait before a cache rebuild.

Currently, only SQLite databases are supported. Using another database should be fairly straightforward to add in, but isn't available yet.

You can specify ":memory" as the cache_dbname to build the cache in memory if required.

API

API reference as follows:

new

Set up the initial object by calling the new method on it. It is important to pass a valid user id and api key (available from http://api.eve-online.com/) or this module will not do anything useful. That is does anything useful at all is debatable, but it does let me print out my favourite character's account balance, so that's pretty much all I want/need it to do at the moment... :-)

    my $eve = WebService::EveOnline->new({
		user_id => <user_id>,
		api_key => '<api_key>'
	});

$eve->user_id

Returns the current user_id.

$eve->api_key

Returns the current api_key.

$eve->character_id(<character_id>)

Returns a character object based on the character id you provide, assuming your API key allows it.

$eve->characters, $eve->character

Returns an array of character objects for the characters available via your API key.

The 'character' call is provided for grammatical sense where appropriate.

$character->name

Returns the name of the current character based on the character object.

$character->skills

Returns an array of the skills held by the selected character.

$character->attributes

Returns an array of attributes held by the selected character.

$character->attribute_enhancers

Returns an array of the attribute enhancers held by the selected character.

$character->account_balance

The account balance of the selected character.

$character->race

The race of the selected character.

$character->bloodline

The bloodline of the selected character.

$character->gender

The gender of the selected character.

$character->training

Returns the skill currently in training for the selected character.

$character->all_eve_skills

Returns all currently available skills in EVE.

BUGS

If you don't happen to have my specific user_id and api_key, you milage may *seriously* vary. I've not been playing Eve Online all that long, and there are probably dozens of edge cases I need to look at and resolve.

Contributions/patches/suggestions are all gratefully received.

Please report any bugs or feature requests to bug-webservice-eveonline at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WebService-EveOnline. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

MOTIVATION

Frankly, whilst the Eve Online API is better than nothing, it's pretty horrible to work with. I wanted to concentrate on my code rather than parsing results, so I decided to hide the gory details away in a nice module I didn't have to look at much. Having said that, by no means is this code considered anything other than a quick and dirty hack that does precisely the job I want it to do (and no more).

AUTHOR

Chris Carline, <chris at carline.org>

COPYRIGHT & LICENSE

Copyright 2007 Chris Carline, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.