Mercurial > eagle-eye
comparison Ikariam.pm @ 37:7d1e353520ca
just return empty users list, when the score link table is missed.
author | "Rex Tsai <chihchun@kalug.linux.org.tw>" |
---|---|
date | Thu, 16 Oct 2008 21:40:14 +0800 |
parents | 91e387b51aa0 |
children | 5849b6fdc76c |
comparison
equal
deleted
inserted
replaced
36:704d76b67670 | 37:7d1e353520ca |
---|---|
56 | 56 |
57 my $c; | 57 my $c; |
58 my $status = gunzip \$res->content => \$c | 58 my $status = gunzip \$res->content => \$c |
59 or die "gunzip failed: $GunzipError\n"; | 59 or die "gunzip failed: $GunzipError\n"; |
60 | 60 |
61 my %users; | |
61 my $html = HTML::TagParser->new($c); | 62 my $html = HTML::TagParser->new($c); |
62 | |
63 my ($table) = $html->getElementsByAttribute("class", "table01"); | 63 my ($table) = $html->getElementsByAttribute("class", "table01"); |
64 return %users if(!defined($table)); | |
65 | |
64 my @elems = getElementsByTagName($table, "tr"); | 66 my @elems = getElementsByTagName($table, "tr"); |
65 | 67 |
66 my %users; | |
67 foreach my $elem (@elems) { | 68 foreach my $elem (@elems) { |
68 my $e; | 69 my $e; |
69 my %user; | 70 my %user; |
70 | 71 |
71 $e = getElementsByAttribute($elem, "class", "action"); | 72 $e = getElementsByAttribute($elem, "class", "action"); |