# HG changeset patch # User "Rex Tsai " # Date 1228655601 -28800 # Node ID 5fc26f2af95b77e6538cfb866b64d7379565ca03 # Parent 986a75252cb3261e24df79e203f420c3caf6d84d# Parent b3b845d30d4b85e74e6defe509c17ed52eaf49a5 merged. diff -r 986a75252cb3 -r 5fc26f2af95b Ikariam.pm --- 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"); + } } } diff -r 986a75252cb3 -r 5fc26f2af95b spy.pl --- 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->{$_});