blib/lib/Chess/ICC.pm

filter: Statementstmt 97.0% 33 / 34 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 95.1% 39 / 41 CC 1 SCAR 0.0
CC
1
Cov
97%
games
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
↑ Summary
1 package Chess::ICC;
2  
3 1 require 5.005_62;
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use HTML::TreeBuilder;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use LWP::Simple;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 require Exporter;
12  
13 1 our @ISA = qw(Exporter);
14  
15 # Items to export into callers namespace by default. Note: do not export
16 # names by default without a very good reason. Use EXPORT_OK instead.
17 # Do not simply export all your public functions/methods/constants.
18  
19 # This allows declaration use Chess::ICC ':all';
20 # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
21 # will save memory.
22 1 our %EXPORT_TAGS = ( 'all' => [ qw(
23
24 ) ] );
25  
26 1 our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
27  
28 1 our @EXPORT = qw(
29
30 );
31 1 our $VERSION = '0.02';
32  
33  
34 # Preloaded methods go here.
35  
36 1 ▶sub games {
Subroutine games: called CC=1 SCAR=0.0
Pod undocumented
37 1 my (undef, %cfg) = @_;
38 1 my $url = "http://www.chessclub.com/finger/$cfg{of}";
39 1 warn "querying $url";
40 1 my $content = get $url;
41 1 my $tree = HTML::TreeBuilder->new_from_content($content);
42 # warn $tree;
43 1 warn $content;
44 1 my $h3 = $tree->look_down('_tag' => 'h3');
45 1 my $table = $tree->look_down('_tag' => 'table');
46 1 my @tr = $table->look_down('_tag' => 'tr');
47 0 warn "we have ", scalar @tr, " rows";
48 # warn Dumper($games);
49 }
50  
51 1 1;
52 __END__
↑ Summary