comparison spy.pl @ 284:10f14db31151

added new dump spy info function
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Thu, 04 Dec 2008 03:22:11 +0800
parents
children b3b845d30d4b
comparison
equal deleted inserted replaced
281:0d2c2a379c63 284:10f14db31151
1 #!/usr/bin/perl
2
3 use strict;
4 use Ikariam;
5 use Data::Dumper;
6 use Decision::ParseTree q{ParseTree};
7 use YAML qw/LoadFile Dump DumpFile/;
8
9 our $i = new Ikariam($::server, $::user, $::pass);
10 $i->login;
11 # $i->check();
12 foreach (glob("city-*-dump.yaml")) {
13 my $city = LoadFile($_);
14 $i->{'cities'}->{$city->{id}} = $city;
15
16 my $spydata = $i->checkSafeHouse($city->{id});
17 foreach (keys(%{$spydata})) {
18 DumpFile("spy-$_-dump.yaml", $spydata->{$_});
19 }
20 }
21 $i->logout;
22