diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/spy.pl	Thu Dec 04 03:22:11 2008 +0800
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+
+use strict;
+use Ikariam;
+use Data::Dumper;
+use Decision::ParseTree q{ParseTree};
+use YAML qw/LoadFile Dump DumpFile/;
+
+our $i = new Ikariam($::server, $::user, $::pass);
+$i->login;
+# $i->check();
+foreach (glob("city-*-dump.yaml")) {
+    my $city = LoadFile($_);
+    $i->{'cities'}->{$city->{id}} = $city;
+ 
+    my $spydata = $i->checkSafeHouse($city->{id});
+    foreach (keys(%{$spydata})) {
+        DumpFile("spy-$_-dump.yaml", $spydata->{$_});
+    }
+}
+$i->logout;
+