diff Ikariam.pm @ 359:4bea7db828eb

fixed scanner
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Mon, 23 Feb 2009 16:24:35 +0800
parents 824f949bc484
children d9d3cdff27c6
line wrap: on
line diff
--- a/Ikariam.pm	Mon Feb 23 16:24:22 2009 +0800
+++ b/Ikariam.pm	Mon Feb 23 16:24:35 2009 +0800
@@ -242,18 +242,19 @@
     my $nodes = jsonToObj($c);
     my @islands;
 
-    print $nodes->{'data'};
+# print Dumper($nodes->{'data'});
     foreach my $x (keys %{$nodes->{'data'}}) {
         foreach my $y (keys(%{$nodes->{data}->{$x}})) {
             my %island;
-            $island{id} = $nodes->{data}->{$x}->{$y}[0];
             $island{x} = $x;
             $island{y} = $y;
+
+            $island{id} = $nodes->{data}->{$x}->{$y}[0];
             $island{name} = $nodes->{data}->{$x}->{$y}[1];
+            $island{tradegood} = $nodes->{data}->{$x}->{$y}[2];
+            $island{wonder} = $nodes->{data}->{$x}->{$y}[3];
+            $island{people} = $nodes->{data}->{$x}->{$y}[6];
  
-# $island{tradegood} = $4;
-# $island{wonder} = $5;
-# $island{people} = $8;
             push @islands, \%island;
         }
     }