Mercurial > eagle-eye
comparison Ikariam.pm @ 104:b369fe3c1992
fixed typo and war counting
author | "Rex Tsai <chihchun@kalug.linux.org.tw>" |
---|---|
date | Wed, 29 Oct 2008 15:08:34 +0800 |
parents | 592d3b3b7898 |
children | 31803acb9c5f |
comparison
equal
deleted
inserted
replaced
103:6804e9c3c589 | 104:b369fe3c1992 |
---|---|
510 foreach (qw/homeland elsewhere/) { | 510 foreach (qw/homeland elsewhere/) { |
511 $self->{'military'}->{$_} = (); | 511 $self->{'military'}->{$_} = (); |
512 my $result = $extractor->{doc}->find(sprintf('//div[@id="%s"]//ul[@id="battleReports"]/li[@class="enroute"]', $_)); | 512 my $result = $extractor->{doc}->find(sprintf('//div[@id="%s"]//ul[@id="battleReports"]/li[@class="enroute"]', $_)); |
513 foreach my $div ( @$result ) { | 513 foreach my $div ( @$result ) { |
514 my $extractor = new Ikariam::Extractor(content => $div->toString(1)); | 514 my $extractor = new Ikariam::Extractor(content => $div->toString(1)); |
515 my $f = $extractor->find('//div[@class="report"]/a[1]/@href'); | 515 my $t = $extractor->find('//div[@class="report"]/a[1]/@href'); |
516 my $t = $extractor->find('//div[@class="report"]/a[2]/@href'), | 516 my $f = $extractor->find('//div[@class="report"]/a[2]/@href'); |
517 $f = $1 if($f =~ /\?view=island&cityId=(\d+)/); | 517 $f = $1 if($f =~ /\?view=island&cityId=(\d+)/); |
518 $t = $1 if($t =~ /\?view=island&cityId=(\d+)/); | 518 $t = $1 if($t =~ /\?view=island&cityId=(\d+)/); |
519 | 519 |
520 push @{$self->{'military'}->{$_}}, { from => $f, to => $t}; | 520 push @{$self->{'military'}->{$_}}, { from => $f, to => $t}; |
521 if($_ eq 'homeland') { | 521 if($_ eq 'homeland') { |