This gave me an interesting idea. If you could scrape that info using a web-app of some description you might be able to do something interesting with it. Having recently acquired a Microsoft Streets and Trips 2006 with GPS for a stupidly low price, I have been playing around with Latidudinal and Longitudinal coordinates, the Google Maps API, and Javascript/AJAX. I occured to me that if I posted coordinates to my Twitter account, maybe I could scrape those coords off the page and generate a Google Map from them.
It turns out the HttpRequests in AJAX do not like to play outside their own domain (ie. you can't pull data from twitter.com from a page on google pages). So to get around this javascript issue, I used PHP. It's really simple, actually, and here is a rough outline of how it works:
- PHP creates a SimpleXML object that pulls my last twitter entry (in xml format) into a variable.
- The PHP script writes a cookie with the coordinates pulled from twitter.
- PHP forward to another page that uses Javascript (the Google API language of choice).
- The javascript page reads the cookie and parses out the coordinates.
- The javascript uses the coordinates as the centre of a Google Map.
I will post more info later. Still in the debugging / thinking of features stage. I am sure there are a grillion or so real programmers who will shoot holes through my methods. I don't care. As a non-programmer this seems like a pretty slick set up to me.
No comments:
Post a Comment