Program Yahoo! with ColdFusion
ColdFusion MX includes all of the tools necessary to work with the Yahoo! API.
ColdFusion is a development platform for creating web applications. Its tag based template structure is a popular choice for HTML developers who want to move to more dynamic content and are already familiar with using tags. In fact, if you were to glance at a ColdFusion script, you might think the code was standard HTML. Putting together a ColdFusion template is a lot like putting together an HTML page, but you can draw on resources such as databases and web services to bring in dynamic content.
You’ll need to be running a version of ColdFusion MX or later to use this hack, because it relies on the
XmlParse function that was added with the MX release. This function can take an XML document, such as the responses from Yahoo! Search Web Services, and turn it into an object that Cold-Fusion scripts can work with.
The Code
This hack shows how you can quickly use the ColdFusion Markup Language (CFML) to bring in content from Yahoo! Search Web Services. This script assembles the proper request URL based on a querystring variable and gets a response from Yahoo! with the <cfhttp> tag. Then the XmlParse function makes the data available to the script, and the <cfloop> tag goes through each bit of data, adding it to the page.
Save the following code to a file called yahoo_search.cfm and upload it to your server:
<!--- yahoo_search.cfm Accepts a search term and shows the top results. ...