Yahoo! PlaceFinder

jamesmc

Member
Hi,

I am looking at perhaps using the Yahoo! PlaceFinder API but have not done anything like this in the ABL before so am at a loss on where to start.

The documentation says "To access the PlaceFinder Web service, call HTTP GET on the base URI, specifying the input location with one or more URI parameters. The response from PlaceFinder contains geographic data, including latitude and longitude, as well as address information such as street, state, and country.".

I can get an XML response when I use the correct URL in my browser but am unsure how to do the same via code and how to make use of the XML when I get it.

Any help would be appreciated.

OE10.2B02
WinXp
 

jonb

New Member
First step is the HTTP GET and you have a few options.

You could launch an external program like curl or wget with the correct URL. You would have to distribute the program with your application.

You could use the Progress Standard Libraries which includes an http client (I've never used it, so I'm not sure how it works).

You could write your own simplified http client in abl to connect to port 80 and print a few lines of http protocol.

No matter which method you use, you'll end up with xml data. I haven't looked at the Yahoo Placefinder documentation much to see the exact xml schema, but you have a few options in how you deal with it.

The easiest thing, if the data is simple enough, is just to do string matching to extract what you need. If you're looking for a single value in a unique tag that should be fine.

If the xml has a Progress-compatible structure, you can load the xml into a temp-table or prodataset then query it like normal. Check the manual for read-xml.

The Progress Standard Libraries also include some xml handling functions that might work for you.

Finally, there are two lower-level xml apis, the SAX streaming api and the document-based api. Either will work.
 

jamesmc

Member
Thanks for the advice. I think you joined in the thread over on the PEG as well with regards to using a PDS? It worked well BTW.
 
Top