Article Image

I've created a Coldfusion tag to make using YQL (even) easier. I was really surprised to find nothing doing this already. I'm not sure if it is just to simple in the first place or that there is a general lack of interest. Feel free to shed some light on this in the comments. Enough talking already, lets get some demo action going.

The basic usage is pretty similar to another oh-so familiar tag:

Select * from

<cfloop query="cfyql">
 <!---Format of the static urls to flickr images--->
   <img src="" />


Top Flickr Photos

As you can see, the format is pretty similar to cfquery. The table name "" is table supported by the YQL (for a full listing of available tables see the footnotes).

Here is another example using an RSS feed:

<cf_yql format="query">
select * from rss where url=''
limit 5

<cfloop query="cfyql">
 <cfoutput><a href="#link#">#title# &mdash; #Source# &mdash; #pubdate#</a>


News Feed

In the future, I'd like to take this further by using YQL's newly added 'execute' functionality.

The project is hosted on github. Feel free to fork me or download the code here.

Edit: Yes, I know this looks like Ray Camden's cf_yql example ( posted earlier today (9/10/09). I had written this post originally on 8/28 and just never got around to publishing it. Ray just lit a fire under my arse by posting his, so thanks Ray!

Items referenced while writing this post:
Blog Logo

Jon Dowdle

Jon Dowdle currently works on the internet at a lovely place called InVision.



Jon Dowdle's Blog

The personal blog of Jon Dowdle.

Back to Overview