comparison Ikariam.pm @ 240:937fc672df56

count by Ally's score
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Fri, 07 Nov 2008 15:01:11 +0800
parents 978a949602e5
children 5f6f845bbb1d
comparison
equal deleted inserted replaced
239:38e1a82627a9 240:937fc672df56
138 138
139 my %ally; 139 my %ally;
140 $ally{'id'} = $allyId; 140 $ally{'id'} = $allyId;
141 $ally{'name'} = $extractor->find("//table[\@id='allyinfo']/tr[1]/td[2]/text()"); 141 $ally{'name'} = $extractor->find("//table[\@id='allyinfo']/tr[1]/td[2]/text()");
142 $ally{'members'} = $extractor->find("//table[\@id='allyinfo']/tr[2]/td[2]/text()"); 142 $ally{'members'} = $extractor->find("//table[\@id='allyinfo']/tr[2]/td[2]/text()");
143 $ally{'score'} = $extractor->find("//table[\@id='allyinfo']/tr[4]/td[2]/text()");
144 $ally{'score'} =~ s/\d+ \(([\d,]+)\)/$1/;
145 $ally{'score'} =~ s/,//g;
146
143 $ally{'url'} = $extractor->find("//table[\@id='allyinfo']/tr[5]/td[2]/text()"); 147 $ally{'url'} = $extractor->find("//table[\@id='allyinfo']/tr[5]/td[2]/text()");
144 delete($ally{'url'}) if($ally{'url'} eq '-'); 148 delete($ally{'url'}) if($ally{'url'} eq '-');
145 149
146 return \%ally; 150 return \%ally;
147 } 151 }