Mercurial > eagle-eye
diff Ikariam.pm @ 6:2975a94aa7a2
removed test code.
author | "Rex Tsai <chihchun@kalug.linux.org.tw>" |
---|---|
date | Wed, 08 Oct 2008 01:52:18 +0800 |
parents | dbb97c4265ba |
children | 2040ccc95670 |
line wrap: on
line diff
--- a/Ikariam.pm Wed Oct 08 01:51:28 2008 +0800 +++ b/Ikariam.pm Wed Oct 08 01:52:18 2008 +0800 @@ -43,21 +43,17 @@ my $user = shift || ''; my $offset = shift || 0; -# my $res = $self->{mech}->post(sprintf("http://%s/index.php?view=worldmap_iso", $self->{server}), [ -# highscoreType => $type, -# offset => $offset, -# searchUser => $user, -# view => 'highscore' -# ]); -# -# my $c; -# my $status = gunzip \$res->content => \$c -# or die "gunzip failed: $GunzipError\n"; + my $res = $self->{mech}->post(sprintf("http://%s/index.php?view=worldmap_iso", $self->{server}), [ + highscoreType => $type, + offset => $offset, + searchUser => $user, + view => 'highscore' + ]); my $c; - open(IN, "f"); - while(<IN>) { $c .= $_;} - close(IN); + my $status = gunzip \$res->content => \$c + or die "gunzip failed: $GunzipError\n"; + my $html = HTML::TagParser->new($c); my ($table) = $html->getElementsByAttribute("class", "table01"); @@ -206,13 +202,7 @@ $info{'ownerId'} = $1; $info{'cityId'} = $2; } - push @cities, \%info; - #foreach my $i (sort(keys(%info))) - #{ - # printf("%s: %s ", $i, $info{$i}); - # } - # printf("\n"); } return @cities;