# HG changeset patch # User "Rex Tsai " # Date 1225447281 -28800 # Node ID aad08889ddb3be5579b34c702aa0cdb3aa1b88ce # Parent 9fb18f3d6e2622c9a1de10574150f8aa739be44a hacked for s4.ikariam.tw diff -r 9fb18f3d6e26 -r aad08889ddb3 Ikariam.pm --- a/Ikariam.pm Fri Oct 31 16:13:36 2008 +0800 +++ b/Ikariam.pm Fri Oct 31 18:01:21 2008 +0800 @@ -578,10 +578,15 @@ $report{defender} = $extractor->find('//div[@id="troopsReport"]//table[@id="result"]//th[@class="defenders"]'); $report{winner} = $extractor->find('//div[@id="troopsReport"]//table[@id="result"]//td[@class="winner"]'); - # $report{targetCity} = $extractor->find('//div[@id="troopsReport"]/div/h3/a/text()'); - # my $href = $extractor->find('//div[@id="troopsReport"]/div/h3/a/@href'); - $report{targetCity} = $extractor->find('//td[@class="battle"]/a/text()'); - my $href = $extractor->find('//td[@class="battle"]/a/@href'); + my $href; + if($self->{server} ne "s4.ikariam.tw") { + $report{targetCity} = $extractor->find('//div[@id="troopsReport"]/div/h3/a/text()'); + $href = $extractor->find('//div[@id="troopsReport"]/div/h3/a/@href'); + } else { + $report{targetCity} = $extractor->find('//td[@class="battle"]/a/text()'); + $href = $extractor->find('//td[@class="battle"]/a/@href'); + } + if($href =~ /index\.php\?view=island&id=(\d+)&selectCity=(\d+)/) { $report{island} = $1; $report{city} = $2;