Mercurial > eagle-eye
view ally.pl @ 373:dd3d76f43999
update script for collecting ally information.
author | "Rex Tsai <chihchun@kalug.linux.org.tw>" |
---|---|
date | Tue, 14 Apr 2009 17:00:40 +0800 |
parents | a60cf4d1a6dd |
children |
line wrap: on
line source
#!/usr/bin/perl use strict; use Ikariam; use Data::Dumper; use List::Util qw[min max]; package main; # my $users = Ikariam::User->search(ally => 'WMeMe'); Ikariam::Cities->set_sql(ally => qq { SELECT cities.cityId FROM cities WHERE cities.ally == ? }); Ikariam::Island->has_many(cities => 'Ikariam::Cities'); Ikariam::Island->set_sql(ally => qq { SELECT island.id FROM island, cities WHERE cities.island == island.id AND cities.ally == ? }); die("Usage: $0\nUsage: $0 ally\n") unless ($#ARGV == 0); my @cities = Ikariam::Cities->search_ally($ARGV[0]); print Dumper(@cities);