OSDN Git Service

Fix finds.jp support.
authormatusita <matusita@180c8125-5b33-4295-ad04-72a68a15b4cc>
Fri, 25 Sep 2009 15:05:48 +0000 (15:05 +0000)
committermatusita <matusita@180c8125-5b33-4295-ad04-72a68a15b4cc>
Fri, 25 Sep 2009 15:05:48 +0000 (15:05 +0000)
See also: http://www.finds.jp/wsdocs/rgeocode/

lib/plugins/00location_receiver

index 089ebbd..2c52a78 100644 (file)
@@ -1,7 +1,7 @@
 # -*- mode: perl; coding: utf-8 -*-
 # keitairc/lib/plugins/00location_receiver
 # 位置情報送信、のコールバック
-# $Id: 00location_receiver,v 1.15 2009-09-24 16:17:00 morimoto Exp $
+# $Id: 00location_receiver,v 1.16 2009-09-25 15:05:48 matusita Exp $
 # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/plugins/00location_receiver,v $
 #
 # The line number (1 incremented) and filename below must be
@@ -31,12 +31,12 @@ sub get_rgeocode_finds {
                $xml_code .= $buf;
        }
        my $xml = XMLin($xml_code);
-       if($xml->{status} ne 'true'){
+       if($xml->{status} ne '200'){
                return;
        }
-       return $xml->{prefecture}->{pname} .
-               $xml->{municipality}->{mname} .
-               $xml->{local}->{section};
+       return $xml->{result}->{prefecture}->{pname} .
+               $xml->{result}->{municipality}->{mname} .
+               $xml->{result}->{local}->{section};
 }
 
 # maps.google.com を使ってgeocode逆変換