Permalink
Browse files

initial import of Games::WoW::Armory 0.000007 from CPAN

git-cpan-module:   Games::WoW::Armory
git-cpan-version:  0.000007
git-cpan-authorid: FRANCKC
  • Loading branch information...
0 parents commit 7b9e92e60a1d4cb455084f5b68c5db2b1aa74bc5 @fcuny fcuny committed with Petru Ratiu Apr 7, 2010
Showing with 888 additions and 0 deletions.
  1. +26 −0 Changes
  2. +13 −0 MANIFEST
  3. +19 −0 META.yml
  4. +23 −0 Makefile.PL
  5. +47 −0 README
  6. +150 −0 examples/wowinfo.pl
  7. +547 −0 lib/Games/WoW/Armory.pm
  8. +7 −0 t/00.load.t
  9. +32 −0 t/01.armory.t
  10. +3 −0 t/kwalitee.t
  11. +9 −0 t/perlcritic.t
  12. +6 −0 t/pod-coverage.t
  13. +6 −0 t/pod.t
26 Changes
@@ -0,0 +1,26 @@
+Revision history for Games-WoW-Armory
+
+0.0.7 Jeu 27 sep 12:56:29 2007
+ - big update by Andrew Yochum (fix realm, new tests, ...)
+
+0.0.6 Fri Jun 01 21:30:00 2007
+ - pod update (added =item)
+
+0.0.5 Fri Jun 01 16:40:00 2007
+ - a non-case-sensitive regex for matching country
+ (as suggested by sabine.hurka@freeda.info)
+ - Games::WoW::Armory::Character
+ - Games::WoW::Armory::Guild
+ - Games::WoW::Armory::Team
+ - get informations about a team
+ - store information about a character in $self->character, which is
+ a Games::WoW::Character object
+ - store information about a guild in $self->guild, which is a
+ Games::WoW::Guild object
+ - store information about a team in $self->team, which is a
+ Games::WoW::Team object
+ - improve POD
+
+0.0.1 Tue Mar 13 14:35:16 2007
+ Initial release.
+
@@ -0,0 +1,13 @@
+Changes
+examples/wowinfo.pl
+lib/Games/WoW/Armory.pm
+Makefile.PL
+MANIFEST
+META.yml
+README
+t/00.load.t
+t/01.armory.t
+t/kwalitee.t
+t/perlcritic.t
+t/pod-coverage.t
+t/pod.t
@@ -0,0 +1,19 @@
+--- #YAML:1.0
+name: Games-WoW-Armory
+version: 0.0.7
+abstract: Access to the WoW Armory
+license: perl
+generated_by: ExtUtils::MakeMaker version 6.36
+distribution_type: module
+requires:
+ Class::Accessor::Fast: 0
+ LWP::UserAgent: 0
+ Test::More: 0
+ Test::Perl::Critic: 0
+ version: 0
+ XML::Simple: 0
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.2.html
+ version: 1.2
+author:
+ - franck cuny <franck.cuny@gmail.com>
@@ -0,0 +1,23 @@
+use strict;
+use warnings;
+use ExtUtils::MakeMaker;
+eval 'use ExtUtils::MakeMaker::Coverage';
+warn "Optional ExtUtils::MakeMaker::Coverage not available\n" if $@;
+
+WriteMakefile( NAME => 'Games::WoW::Armory',
+ AUTHOR => 'franck cuny <franck.cuny@gmail.com>',
+ LICENSE => 'perl',
+ VERSION_FROM => 'lib/Games/WoW/Armory.pm',
+ ABSTRACT_FROM => 'lib/Games/WoW/Armory.pm',
+ PL_FILES => {},
+ PREREQ_PM => {
+ 'Test::More' => 0,
+ 'version' => 0,
+ 'LWP::UserAgent' => 0,
+ 'XML::Simple' => 0,
+ 'Class::Accessor::Fast' => 0,
+ 'Test::Perl::Critic' => 0,
+ },
+ dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
+ clean => { FILES => 'Games-WoW-Armory-*' },
+);
47 README
@@ -0,0 +1,47 @@
+Games-WoW-Armory version 0.0.1
+
+[ REPLACE THIS...
+
+ The README is used to introduce the module and provide instructions on
+ how to install the module, any machine dependencies it may have (for
+ example C compilers and installed libraries) and any other information
+ that should be understood before the module is installed.
+
+ A README file is required for CPAN modules since CPAN extracts the
+ README file from a module distribution so that people browsing the
+ archive can use it get an idea of the modules uses. It is usually a
+ good idea to provide version information here so that people can
+ decide whether fixes for the module are worth downloading.
+]
+
+
+INSTALLATION
+
+To install this module, run the following commands:
+
+ perl Makefile.PL
+ make
+ make test
+ make install
+
+
+Alternatively, to install with Module::Build, you can use the following commands:
+
+ perl Build.PL
+ ./Build
+ ./Build test
+ ./Build install
+
+
+
+DEPENDENCIES
+
+None.
+
+
+COPYRIGHT AND LICENCE
+
+Copyright (C) 2007, franck cuny
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.
@@ -0,0 +1,150 @@
+#!/usr/bin/perl -w
+
+use strict;
+use lib ( '../lib' );
+use Getopt::Simple qw($switch);
+use Games::WoW::Armory;
+
+my ( $options ) = {
+ help => {
+ type => '',
+ env => '-',
+ default => '',
+ verbose => 'this help',
+ order => 1,
+ },
+ character => {
+ type => '=s',
+ env => '-',
+ default => '',
+ verbose => 'character name',
+ order => 2,
+ },
+ guild => {
+ type => '=s',
+ env => '-',
+ default => '',
+ verbose => 'guild name',
+ order => 3,
+ },
+ realm => {
+ type => '=s',
+ env => '-',
+ default => '',
+ verbose => 'realm name',
+ order => 4,
+
+ },
+ country => {
+ type => '=s',
+ env => '-',
+ default => '',
+ verbose => 'Region name (EU|US)',
+ order => 5,
+
+ },
+ team => {
+ type => '=s',
+ env => '-',
+ default => '',
+ verbose => 'name of a team',
+ order => 6,
+ },
+ ts => {
+ type => '=s',
+ env => '-',
+ default => '',
+ verbose => '2|3|5',
+ order => 7,
+ },
+ battlegroup => {
+ type => '=s',
+ env => '-',
+ default => '',
+ verbose => 'Battlegroup name',
+ order => 8,
+ }
+};
+
+my $o = Getopt::Simple->new();
+if ( !$o->getOptions( $options, "Usage : $0 [options]" ) ) {
+ exit( -1 );
+}
+
+my $armory = Games::WoW::Armory->new();
+
+if ( !defined $$switch{ 'realm' } ) {
+ die "you have to give a realm name";
+}
+
+if ( !defined $$switch{ 'country' } ) {
+ die "you have to give a country name (EU|US)";
+}
+
+if ( $$switch{ 'character' } && $$switch{ 'guild' } ) {
+ die "please, specify only a character name OR a guild name";
+}
+
+if ( $$switch{ 'character' } ) {
+ search_character();
+}elsif ($$switch{'battlegroup'}){
+ search_team();
+}else {
+ search_guild();
+}
+
+sub search_guild {
+ $armory->search_guild(
+ { realm => $$switch{ 'realm' },
+ guild => $$switch{ 'guild' },
+ country => $$switch{ 'country' }
+ }
+ );
+ foreach my $member ( keys %{ $armory->members } ) {
+ print "- " . $member . " ("
+ . $armory->members->{ $member }{ class } . " "
+ . $armory->members->{ $member }{ race }
+ . ") lvl "
+ . $armory->members->{ $member }{ level } . "\n";
+ }
+}
+
+sub search_character {
+ $armory->search_character(
+ { realm => $$switch{ 'realm' },
+ character => $$switch{ 'character' },
+ country => $$switch{ 'country' }
+ }
+ );
+ print "- "
+ . $armory->character->{ name } . " ("
+ . $armory->character->{ class } . " "
+ . $armory->character->{ race } . ") "
+ . $armory->character->{ level } . "\n";
+
+ if ( scalar @{ $armory->character->heroic_access } == 0 ) {
+ print "No heroic access yet.\n";
+ }
+ else {
+ print "\tHeroic Access:\n";
+ foreach my $key ( @{ $armory->character->heroic_access } ) {
+ print "Have access to the $key.\n";
+ }
+ }
+
+}
+
+sub search_team {
+ $armory->search_team(
+ { team => $$switch{ 'team' },
+ ts => $$switch{ 'ts' },
+ battlegroup => $$switch{ 'battlegroup' },
+ country => $$switch{'country'},
+ }
+ );
+
+ print $armory->team->name." ".$armory->team->realm."\n";
+ foreach my $m (@{$armory->team->members}){
+ print $m->name." ".$m->race." ".$m->level."\n";
+ }
+}
Oops, something went wrong.

0 comments on commit 7b9e92e

Please sign in to comment.