<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -9,6 +9,7 @@
         'city':'usercity',
         'latitude':'userlat',
         'longitude':'userlon',
+        'postcode':'userpostcode',
         'country':'usercountry'
       }
     );</diff>
      <filename>addbutton.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 /*
   GeoFill by Christian Heilmann
-  Version: 1.0
+  Version: 1.1
   Homepage: http://icant.co.uk/geofill
   Copyright (c) 2009, Christian Heilmann
   Code licensed under the BSD License:
@@ -9,9 +9,10 @@
 geofill = function(){
   var fieldstofill = null;
   var postcode = null;
+  var ipdata = null;
   function find(o){
     fieldstofill = o;
-    get('http://geoip.pidgets.com/?format=json&amp;callback=geofill.set');
+    get('http://geoip.pidgets.com/?format=json&amp;callback=geofill.getpc');
   }
   function lookup(pc){
     postcode = pc;
@@ -66,13 +67,24 @@ geofill = function(){
     s.setAttribute('src',url);
     document.getElementsByTagName('head')[0].appendChild(s);
   }
+  function getPostalfromIP(o){
+    ipdata = o;
+    // god I friggin love YQL
+    var url = 'http://query.yahooapis.com/v1/public/yql?q=select'+
+              '%20postal%20from%20geo.places%20where%20woeid%20in%20'+
+              '(select%20place.woeid%20from%20flickr.places%20where'+
+              '%20lat%3D%22'+o.latitude+'%22%20and%20lon%3D%22'+
+              o.longitude+'%22)&amp;format=json&amp;callback=geofill.set';
+    get(url);
+  }
+  
   function set(o){
     var filtered = {
-      city:o.city,
-      country:o.country_name,
-      postcode:o.postal_code,
-      latitude:o.latitude,
-      longitude:o.longitude
+      city:ipdata.city,
+      country:ipdata.country_name,
+      postcode:o.query.results.place.postal.content,
+      latitude:ipdata.latitude,
+      longitude:ipdata.longitude
     }
     for(var i in fieldstofill){
       var x = document.getElementById(fieldstofill[i]);
@@ -84,5 +96,11 @@ geofill = function(){
       fieldstofill.callback(filtered);
     }
   }
-  return {set:set,find:find,pc:setPostcode,lookup:lookup}
+  return {
+    set:set,
+    find:find,
+    pc:setPostcode,
+    lookup:lookup,
+    getpc:getPostalfromIP
+  }
 }();</diff>
      <filename>geofill.js</filename>
    </modified>
    <modified>
      <diff>@@ -48,7 +48,7 @@
     color:#fff;
   }
   #ft a{
-    color:#fc6;
+    color:#9cf;
   }
   html,body{
     background:#666;
@@ -57,31 +57,59 @@
     padding:.2em 0;
   }
   #bd{background:#fff;border:1em solid #fff;}
+#nav li{
+  list-style:none;
+}
+#nav li a {
+  background:#369;
+  color:#fff;
+  padding:.2em 1em;
+  display:block;
+  text-decoration:none;
+  -moz-border-radius:5px;
+  margin:.5em 0;
+  color:#fff;
+}
+#nav li a:hover {
+  background:#69c;
+}
   &lt;/style&gt;
 &lt;/head&gt;
 &lt;body&gt;
 &lt;div id=&quot;doc&quot; class=&quot;yui-t7&quot;&gt;
   &lt;div id=&quot;hd&quot; role=&quot;banner&quot;&gt;&lt;h1&gt;GeoFill - automatically filling form data with geo information&lt;/h1&gt;&lt;/div&gt;
   &lt;div id=&quot;bd&quot; role=&quot;main&quot;&gt;
-    &lt;p&gt;Wouldn't it be cool to be able to allow users to automatically fill parts of a form, especially the location part of addresses? Services like &lt;a href=&quot;http://fireeagle.yahoo.net/&quot;&gt;FireEagle&lt;/a&gt; allow you to do that but it is not very likely that mainstream users will have signed up to them.&lt;/p&gt;
-    &lt;p&gt;One thing we can do is recognise the user's IP number or allow the user to enter one thing and try to guess the rest for them. GeoFill is a JavaScript wrapper library that uses Yahoo Geo and GeoIP to do that for you. Try the following examples:&lt;/p&gt;
-    
-    &lt;h2&gt;Examples&lt;/h2&gt;
+       &lt;div class=&quot;yui-gc&quot;&gt;
+         &lt;div class=&quot;yui-u first&quot;&gt;
+           &lt;p&gt;Wouldn't it be cool to be able to allow users to automatically fill parts of a form, especially the location part of addresses? Services like &lt;a href=&quot;http://fireeagle.yahoo.net/&quot;&gt;FireEagle&lt;/a&gt; allow you to do that but it is not very likely that mainstream users will have signed up to them.&lt;/p&gt;
+           &lt;p&gt;One thing we can do is recognise the user's IP number or allow the user to enter one thing and try to guess the rest for them. GeoFill is a JavaScript wrapper library that uses Yahoo Geo and GeoIP to do that for you. Try the following examples:&lt;/p&gt;
+           &lt;h2&gt;Examples&lt;/h2&gt;
 
-    &lt;ul id=&quot;demos&quot;&gt;
-      &lt;?php
-        $demos = array('suggestion'=&gt;'Provide a location suggestion based on IP','searchbutton'=&gt;'Provide a button to get data','postcode'=&gt;'Lookup from postcode');
-        foreach(array_keys($demos) as $d){
-          if($_GET['demo']===$d){
-            echo '&lt;li&gt;&lt;strong&gt;'.$demos[$d].'&lt;/strong&gt;&lt;/li&gt;';
-          } else {
-            echo '&lt;li&gt;&lt;a href=&quot;index.php?demo='.$d.'&quot;&gt;'.$demos[$d].'&lt;/a&gt;&lt;/li&gt;';
-          }
-        }
-      
-      
-      ?&gt;
-    &lt;/ul&gt;
+           &lt;ul id=&quot;demos&quot;&gt;
+             &lt;?php
+               $demos = array('suggestion'=&gt;'Provide a location suggestion based on IP','searchbutton'=&gt;'Provide a button to get data','postcode'=&gt;'Lookup from postcode');
+               foreach(array_keys($demos) as $d){
+                 if($_GET['demo']===$d){
+                   echo '&lt;li&gt;&lt;strong&gt;'.$demos[$d].'&lt;/strong&gt;&lt;/li&gt;';
+                 } else {
+                   echo '&lt;li&gt;&lt;a href=&quot;index.php?demo='.$d.'&quot;&gt;'.$demos[$d].'&lt;/a&gt;&lt;/li&gt;';
+                 }
+               }
+
+
+             ?&gt;
+           &lt;/ul&gt;
+           
+         &lt;/div&gt;
+         &lt;div class=&quot;yui-u&quot;&gt;
+            &lt;ul id=&quot;nav&quot;&gt;
+              &lt;li&gt;&lt;a href=&quot;http://www.wait-till-i.com/2009/06/07/adding-address-information-automatically-to-forms-with-geofill/&quot;&gt;Comment on the blog&lt;/a&gt;&lt;/li&gt;
+              &lt;li&gt;&lt;a href=&quot;http://github.com/codepo8/JavaScript-Geo-Fill/tree/master&quot;&gt;GeoFill on GitHub&lt;/a&gt;&lt;/li&gt;
+            &lt;/ul&gt;
+          
+         &lt;/div&gt;
+       &lt;/div&gt;
+    
     &lt;?php if(isset($_GET['demo'])){?&gt;
        &lt;div class=&quot;yui-gc&quot;&gt;
          &lt;div class=&quot;yui-u  first&quot;&gt;</diff>
      <filename>index.php</filename>
    </modified>
    <modified>
      <diff>@@ -17,6 +17,7 @@
         but.onclick = function(){
           $('usercity').value = o.city;
           $('usercountry').value = o.country;
+          $('userpostcode').value = o.postcode;
           $('userlat').value = o.latitude;
           $('userlon').value = o.longitude;
           function $(id){</diff>
      <filename>suggestion.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>9a89c45f30768b891744a5477322e6e8beaff7ff</id>
    </parent>
  </parents>
  <author>
    <name>Christian Heilmann</name>
    <email>chris.heilmann@gmail.com</email>
  </author>
  <url>http://github.com/codepo8/JavaScript-Geo-Fill/commit/21a67d424835069cea18cfb9692240f1916b929e</url>
  <id>21a67d424835069cea18cfb9692240f1916b929e</id>
  <committed-date>2009-06-08T08:16:12-07:00</committed-date>
  <authored-date>2009-06-08T08:16:12-07:00</authored-date>
  <message>added postcode lookup for ID results!</message>
  <tree>18d13d8efa4db531b66f07be94b69ba3180cb685</tree>
  <committer>
    <name>Christian Heilmann</name>
    <email>chris.heilmann@gmail.com</email>
  </committer>
</commit>
