<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -4,11 +4,54 @@
   Geocoding and Location Awareness API
   -------------------------------------------------------*/
 
+class pahaki
+{
+  public $lat;         /* Latitude */
+  public $lon;         /* Longitude */
+  public $coords;      /* String. Latitude,Longitude */
+  public $city;        /* City Name */
+  public $county;      /* County Name */
+  public $state;       /* Two Letter State Name */
+  public $zip;         /* Zip Code */
+  public $street1;     /* Street #1 (Intersection) */
+  public $street2;     /* Street #2 (Intersection) */
+
+  public function __construct($uuid)
+  {
+    /* Query Xtify for basic position */
+    $cpid = &quot;&quot;;
+    $xml = download('http://query.xtify.com/api/1.0/xml/location?userkey='.$uuid.'&amp;cpid='.$cpid);
+    $x = new SimpleXMLElement(utf8_decode($xml));
+
+    $this-&gt;lat = $x-&gt;locationset-&gt;location-&gt;coords-&gt;lat;
+    $this-&gt;lon = $x-&gt;locationset-&gt;location-&gt;coords-&gt;lon;
+    $this-&gt;coords = $lat.','.$lon;
+
+    /* Reverse Geocoding from geonames.org */
+    $geo = download('http://ws.geonames.org/findNearestIntersection?lat='.$lat.'&amp;lng='.$lon);
+    $x   = new SimpleXMLElement(utf8_decode($geo));
+    $this-&gt;state = $x-&gt;intersection-&gt;adminCode1;
+    $this-&gt;county = $x-&gt;intersection-&gt;adminName2;
+  }
+
+  private function download($url)
+  {
+    $crl = curl_init();
+    $timeout = 8;
+    curl_setopt ($crl, CURLOPT_URL,$url);
+    curl_setopt ($crl, CURLOPT_RETURNTRANSFER, 1);
+    curl_setopt ($crl, CURLOPT_CONNECTTIMEOUT, $timeout);
+    $ret = curl_exec($crl);
+    curl_close($crl);
+    return $ret;
+  }
+}
+
+
 /* Your Xtify CPID */
 $cpid = &quot;&quot;;
 
 
-
 function pahaki_get($url)
 {
   $crl = curl_init();</diff>
      <filename>pahaki.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>f17226a6a5ec9bf3a0862dc2fe168419043f35a9</id>
    </parent>
  </parents>
  <author>
    <name>Charles Childers</name>
    <email>crc.platypus@gmail.com</email>
  </author>
  <url>http://github.com/crcx/pahaki/commit/91a442d092f35507913e9b3bf65a9f2b462f7203</url>
  <id>91a442d092f35507913e9b3bf65a9f2b462f7203</id>
  <committed-date>2009-03-30T03:40:23-07:00</committed-date>
  <authored-date>2009-03-30T03:40:23-07:00</authored-date>
  <message>started work on moving to object-oriented design</message>
  <tree>5b881b18658dae0b729e1637426ccdc6d5ee4b3c</tree>
  <committer>
    <name>Charles Childers</name>
    <email>crc.platypus@gmail.com</email>
  </committer>
</commit>
