Search code examples
phpatom-feedgoogle-latitude

Using PHP to extract data from an ATOM feed and using it reverse lookup coordinates to an actual address


Basically I have a public feed: http://www.google.com/latitude/apps/badge/api?user=-1671995934285587708&type=atom

If you go to my Google Profile you can see it says: "Gareth is in 6 Seaside Gardens, Mullaloo WA 6027, Australia (1 minute ago)" google.com/profiles/Gareth.B.Hall

How can I, using PHP, display my location on a website the same way it's displayed on my Google Profile?

Thanks


Solution

  • You can ask Google's Geocoding API for information about the location. The details are all in that link; you could use an URL like:

    http://maps.google.com/maps/api/geocode/xml?latlng=-31.774891,115.735698&sensor=false

    The value that you probably want would be the formatted_address of 6 Seaside Gardens, Mullaloo WA 6027, Australia.