# HG changeset patch # User "Rex Tsai " # Date 1223401938 -28800 # Node ID 2975a94aa7a2da694c5fbefb908549438d62b5bf # Parent dbb97c4265baf8e66cd8e54fe27728f4aeca4d58 removed test code. diff -r dbb97c4265ba -r 2975a94aa7a2 Ikariam.pm --- 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() { $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;