comparison 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
comparison
equal deleted inserted replaced
144:9fb18f3d6e26 145:aad08889ddb3
576 576
577 $report{attacker} = $extractor->find('//div[@id="troopsReport"]//table[@id="result"]//th[@class="attackers"]'); 577 $report{attacker} = $extractor->find('//div[@id="troopsReport"]//table[@id="result"]//th[@class="attackers"]');
578 $report{defender} = $extractor->find('//div[@id="troopsReport"]//table[@id="result"]//th[@class="defenders"]'); 578 $report{defender} = $extractor->find('//div[@id="troopsReport"]//table[@id="result"]//th[@class="defenders"]');
579 $report{winner} = $extractor->find('//div[@id="troopsReport"]//table[@id="result"]//td[@class="winner"]'); 579 $report{winner} = $extractor->find('//div[@id="troopsReport"]//table[@id="result"]//td[@class="winner"]');
580 580
581 # $report{targetCity} = $extractor->find('//div[@id="troopsReport"]/div/h3/a/text()'); 581 my $href;
582 # my $href = $extractor->find('//div[@id="troopsReport"]/div/h3/a/@href'); 582 if($self->{server} ne "s4.ikariam.tw") {
583 $report{targetCity} = $extractor->find('//td[@class="battle"]/a/text()'); 583 $report{targetCity} = $extractor->find('//div[@id="troopsReport"]/div/h3/a/text()');
584 my $href = $extractor->find('//td[@class="battle"]/a/@href'); 584 $href = $extractor->find('//div[@id="troopsReport"]/div/h3/a/@href');
585 } else {
586 $report{targetCity} = $extractor->find('//td[@class="battle"]/a/text()');
587 $href = $extractor->find('//td[@class="battle"]/a/@href');
588 }
589
585 if($href =~ /index\.php\?view=island&id=(\d+)&selectCity=(\d+)/) { 590 if($href =~ /index\.php\?view=island&id=(\d+)&selectCity=(\d+)/) {
586 $report{island} = $1; 591 $report{island} = $1;
587 $report{city} = $2; 592 $report{city} = $2;
588 } else { 593 } else {
589 warn ("can not read combat reprot $combatId"); 594 warn ("can not read combat reprot $combatId");