Mercurial > eagle-eye
annotate spy.pl @ 356:1ece3379f7a2
merged
author | "Rex Tsai <chihchun@kalug.linux.org.tw>" |
---|---|
date | Sun, 15 Feb 2009 14:21:27 +0800 |
parents | 8a69b96be376 |
children |
rev | line source |
---|---|
284
10f14db31151
added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
1 #!/usr/bin/perl |
10f14db31151
added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
2 |
10f14db31151
added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
3 use strict; |
10f14db31151
added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
4 use Ikariam; |
10f14db31151
added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
5 use Data::Dumper; |
10f14db31151
added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
6 use Decision::ParseTree q{ParseTree}; |
10f14db31151
added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
7 use YAML qw/LoadFile Dump DumpFile/; |
10f14db31151
added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
8 |
305
ff8db948e1a1
list user and city name
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
298
diff
changeset
|
9 Ikariam::Cities->has_a(user => 'Ikariam::User'); |
ff8db948e1a1
list user and city name
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
298
diff
changeset
|
10 |
284
10f14db31151
added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
11 our $i = new Ikariam($::server, $::user, $::pass); |
10f14db31151
added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
12 $i->login; |
10f14db31151
added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
13 # $i->check(); |
10f14db31151
added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
14 foreach (glob("city-*-dump.yaml")) { |
10f14db31151
added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
15 my $city = LoadFile($_); |
10f14db31151
added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
16 my $spydata = $i->checkSafeHouse($city->{id}); |
10f14db31151
added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
17 foreach (keys(%{$spydata})) { |
305
ff8db948e1a1
list user and city name
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
298
diff
changeset
|
18 my $city = Ikariam::Cities->retrieve($_); |
345
8a69b96be376
disabled debug messages
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
305
diff
changeset
|
19 # my $user = $city->user; |
8a69b96be376
disabled debug messages
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
305
diff
changeset
|
20 # printf("%s %s\n", $user->name, $city->cityname); |
284
10f14db31151
added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
21 DumpFile("spy-$_-dump.yaml", $spydata->{$_}); |
10f14db31151
added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
22 } |
10f14db31151
added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
23 } |
10f14db31151
added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
24 $i->logout; |
10f14db31151
added new dump spy info function
"Rex Tsai <chihchun@kalug.linux.org.tw>"
parents:
diff
changeset
|
25 |