Mercurial > eagle-eye
comparison Ikariam.pm @ 96:65c102183458
saved the status of inactivity player
author | "Rex Tsai <chihchun@kalug.linux.org.tw>" |
---|---|
date | Wed, 29 Oct 2008 01:03:04 +0800 |
parents | bcd2e32cfabb |
children | 34749e907405 |
comparison
equal
deleted
inserted
replaced
95:6527b4b20d60 | 96:65c102183458 |
---|---|
89 package Ikariam; | 89 package Ikariam; |
90 use strict; | 90 use strict; |
91 use Data::Dumper; | 91 use Data::Dumper; |
92 use LWP; | 92 use LWP; |
93 # use LWP::Debug qw(+ -conns -trace -debug); | 93 # use LWP::Debug qw(+ -conns -trace -debug); |
94 use LWP::Debug qw(+trace); | 94 # use LWP::Debug qw(+trace); |
95 use HTTP::Cookies; | 95 use HTTP::Cookies; |
96 use WWW::Mechanize; | 96 use WWW::Mechanize; |
97 use HTML::TagParser; | 97 use HTML::TagParser; |
98 use XML::LibXML qw(:encoding); | 98 use XML::LibXML qw(:encoding); |
99 use IO::Uncompress::Gunzip qw(gunzip $GunzipError) ; | 99 use IO::Uncompress::Gunzip qw(gunzip $GunzipError) ; |
293 } | 293 } |
294 } | 294 } |
295 | 295 |
296 if(defined(($extractor->find(sprintf('//li[@id="cityLocation%s"]//span[@class="vacation"]', $i)))[0])) { | 296 if(defined(($extractor->find(sprintf('//li[@id="cityLocation%s"]//span[@class="vacation"]', $i)))[0])) { |
297 $info{'status'} = 'v'; | 297 $info{'status'} = 'v'; |
298 } | |
299 if(defined(($extractor->find(sprintf('//li[@id="cityLocation%s"]//span[@class="inactivity"]', $i)))[0])) { | |
300 $info{'status'} = 'i'; | |
298 } | 301 } |
299 push @cities, \%info; | 302 push @cities, \%info; |
300 } else { | 303 } else { |
301 # TODO: delete the old city. | 304 # TODO: delete the old city. |
302 } | 305 } |