After PHP (beurk...), I made a Perl module to retrieve and parse Planeshift server informations.
This module is available on CPAN and features :
- informations parsing
- easily usable data structure
- not that bad documentation
- and the support for XML translation of the stucture.
The module is named Game::Planeshift::Info, and is available on CPAN :
http://search.cpan.org/search?mode=dist&query=PlaneshiftAt this time I just upload 0.2 version wich correct a little bug in players list for online players. So this version is not yet indexed by PAUSE (the Perl Authors Upload Server) on CPAN.
here is a little code example who retrieve all informations and translates it in XML :
#!/usr/bin/perl
use strict;
use warnings ;
use Game::Planeshift::Info ;
my $ps = Game::Planeshift::Info->new() ;
print $ps->data2xml( $ps->retrieve_info() ) ;
Easy isn\'t it ?
If you want to know if a friend is online, just use :
print \"Ehasara is online\" if( $ps->is_online(\'Ehasara\') ) ;
And the same code but to watch only a couple of buddies :
#!/usr/bin/perl
use strict;
use warnings ;
use Game::Planeshift::Info ;
my $ps = Game::Planeshift::Info->new(
players => [\'Baston\', \'Ehasara\', \'Narita\', \'Setill\', \'Soshise\', \'Mardun\', \'Caules\']
) ;
print $ps->data2xml( $ps->retrieve_info() ) ;
I will put online a page which give the entire Laanx info page in XML for those off you who are to lazy to copy/paste this code in a Perl file ;-)