News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPMaster.com:
Where on Earth are You?
February 02, 2012 @ 08:52:54

In PHPMaster.com's latest tutorial Lukas White introduces you to using the Yahoo "Placemaker" web service to geographically locate a place from a free-form text string. The results include "place details" like the type of the location, latitude, longitude and how confident they are in their match.

The challenge then is to do two things: work out what place you could be talking about, disambiguate if necessary, and then identify exactly where on Earth that is. That's what I'll show you how to do in this article; by using a freely available web service, we'll write a simple program to ask users where they are (and ask them to clarify if necessary) before identifying their responses in concrete terms.

He shows how to make a request to the Placemaker web service, passing it a string coming from the user, to be located. The POST request contains a few pieces of data including an application ID , your desired output type and the language you're using for the input. His example code uses curl to make the request and handles it (the XML response at least) with a call to simplexml_load_string.

0 comments voice your opinion now!
where geolocation yahoo placemaker webservice api tutorial


blog comments powered by Disqus

Similar Posts

Padraic Brady's Blog: An Example Zend Framework Blog App - Part 3: A Simple Hello World Tutorial

Gonzalo Ayuso's Blog: How to protect from SQL Injection with PHP

SitePoint PHP Blog: Mangling XML as Text with PHP DOM

Klaus Graefensteiner's Blog: Climbing the CodeIgniter PHP MVC framework learning curve

Alan Knowles' Blog: Getting Started with HTML_FlexyFramework, DataObjects and HTML_Template_Flexy


Community Events





Don't see your event here?
Let us know!


threedevsandamaybe developer library bugfix application community configure list wordpress api release unittest laravel podcast code language series introduction install interview

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework