changeset 300:5fc26f2af95b

merged.
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Sun, 07 Dec 2008 21:13:21 +0800
parents 986a75252cb3 (current diff) b3b845d30d4b (diff)
children 07f51bb67e56
files
diffstat 2 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Ikariam.pm	Sun Dec 07 21:12:29 2008 +0800
+++ b/Ikariam.pm	Sun Dec 07 21:13:21 2008 +0800
@@ -113,6 +113,7 @@
 use HTTP::Cookies;
 use WWW::Mechanize;
 use XML::LibXML qw(:encoding);
+use YAML qw/LoadFile Dump DumpFile/;
 use IO::Uncompress::Gunzip qw(gunzip $GunzipError) ;
 use POSIX;
 use utf8;
@@ -133,6 +134,7 @@
         debug => undef,
     };
 
+
     # if debug
     LWP::Debug::level('+trace');
 
@@ -1298,9 +1300,12 @@
     if($#cities<0) {
         die ("login failed\n");
     }
-    foreach(@cities) {
+    foreach (@cities) {
         $self->{'cities'}->{$_} = {};
         $self->{'cities'}->{$_}->{id} = $_;
+        if(-f "city-$_-dump.yaml") {
+            $self->{'cities'}->{$_} = LoadFile("city-$_-dump.yaml");
+        }
     }
 }
 
--- a/spy.pl	Sun Dec 07 21:12:29 2008 +0800
+++ b/spy.pl	Sun Dec 07 21:13:21 2008 +0800
@@ -11,8 +11,7 @@
 # $i->check();
 foreach (glob("city-*-dump.yaml")) {
     my $city = LoadFile($_);
-    $i->{'cities'}->{$city->{id}} = $city;
- 
+    # $i->{'cities'}->{$city->{id}} = $city;
     my $spydata = $i->checkSafeHouse($city->{id});
     foreach (keys(%{$spydata})) {
         DumpFile("spy-$_-dump.yaml", $spydata->{$_});