ColdFusion Yahoo Package Updated

I just checked in a new update to the ColdFusion Yahoo Package. This addition has a few small changes but the big addition is in Local Search. Yahoo’s Local Search is pretty darn powerful. You can send in any basic query (“comic books”), along with address information in just about any form. The results are very detailed and include maps, ratings, telephone number, address, web site, etc.

Here is some sample code from the zip:

<cfset localAPI = createObject("component", "")>

<cfset term = “comic book”> <cfset zip = “70508”> <cfinvoke component=”#localAPI#” method=”search” returnVariable=”results”> <cfinvokeargument name=”query” value=”#term#”> <cfinvokeargument name=”zip” value=”#zip#”> </cfinvoke>

<cfoutput> <h2>Local search for #term#/#zip#</h2> </cfoutput>

<cfdump var=”#results#”> </code>

For fun - try this search:

<cfset term = "aliens"> <cfinvoke component="#localAPI#" method="search" returnVariable="results"> <cfinvokeargument name="query" value="#term#"> <cfinvokeargument name="location" value="Roswell, NM"> </cfinvoke>

I tried weapons of mass destruction in Iraq - but somehow I wasn’t able to find any. (Sorry, couldn’t resist.)

Raymond Camden's Picture

About Raymond Camden

Raymond is a developer advocate. He focuses on JavaScript, serverless and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA