diff Ikariam.pm @ 145:aad08889ddb3

hacked for s4.ikariam.tw
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Fri, 31 Oct 2008 18:01:21 +0800
parents bfa78302cf09
children b23077d597b0
line wrap: on
line diff
--- 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;