Earlier today I blogged a Friday Challenge that involved taking the 12 Days of Christmas as a query and generating the song. After I posted this, I had an odd thought - why not see what the Internet (in this case, Yahoo), would do with the gifts.

I used my CFYahoo package to create a connection to their image service:

<cfset imageAPI = createObject("component", "org.camden.yahoo.image")>

Next I created my array and started to loop:

<cfset gifts = ["A partridge in a pear tree","Two turtle doves","Three French hens","Four calling birds","Five golden rings","Six geese a-laying", "Seven swans a-swimming","Eight maids a-milking","Nine ladies dancing","Ten lords a-leaping","Eleven pipers piping","Twelve drummers drumming"]>

<cfloop index="x" from="1" to="#arrayLen(gifts)#">

Then for each item I performed a search. Yahoo filters adult images by default so I didn't have to worry about that:

<cfinvoke component="#imageAPI#" method="search" returnVariable="result"> <cfinvokeargument name="query" value="#gifts[x]#"> <cfinvokeargument name="results" value="1"> </cfinvoke>

Lastly I displayed the result from each search. I did a quick view source/ctrl+a/ctrl+v and below is the results.

Yes, this is a complete and utter waste of time. Enjoy.

Edited: I added my CFM as a zip to this page. I also changed the code to show 3, as it gets interesting with multiple results. For this to work you will need my CFYahoo package and an API key.

Image search for A partridge in a pear tree

0001_137_Partridge_In_A_Pear_Tree.gif

0001_137_Partridge_In_A_Pear_Tree.gif

URL: http://www.bisgrove.com/0001_137_Partridge_In_A_Pear_Tree.gif
Summary: Links: | Site Index |


Image search for Two turtle doves

444966.jpg

444966.jpg

URL: http://images.dpchallenge.com/images_challenge/608/444966.jpg
Summary: Two Turtle Doves


Image search for Three French hens

Three French Hens.jpg

Three French Hens.jpg

URL: http://www.dcist.com/attachments/dcist_melissa/Three%20French%20Hens.jpg
Summary: Washington Wish List: Holiday Hankerings of D.C. Foodies Whether it's Corduroy's scallops with mushroom and potato puree, 2 Amys' cod fritters, or Restaurant Eve's mojitos, DCist indulges in good food and drink about town over the holiday season


Image search for Four calling birds

20-fourcallingbirds72.jpg

20-fourcallingbirds72.jpg

URL: http://www.porterfieldsfineart.com/JohnnyKarwan/images/20-fourcallingbirds72.jpg
Summary: On the fourth day of Christmas my true love gave to me Four calling birds Three french hens


Image search for Five golden rings

Goldrings.jpg

Goldrings.jpg

URL: http://my.homewithgod.com/sweatbj/Graphics/Christmas/Goldrings.jpg
Summary: Five Golden Rings - First five books of the Old Testament. The greatest books to the Jews, worth more than gold.


Image search for Six geese a-laying

VIThe12DaysOfDickensVillageSixGeeseALaying.jpg

VIThe12DaysOfDickensVillageSixGeeseALaying.jpg

URL: http://web.ivenue.com/cobblestonesgiftsclctbls/images/VIThe12DaysOfDickensVillageSixGeeseALaying.jpg
Summary: VI, The 12 Days Of Dickens' Six Geese A-Laying Set Of 2 - Introduced in 1995 - Retired in 1999 - 2.5, 1.25'' tall.Retail Price: $29.95


Image search for Seven swans a-swimming

seven-swans-a-swimming.jpg

seven-swans-a-swimming.jpg

URL: http://www.artshole.co.uk/arts/artists/anna%20charity/seven-swans-a-swimming.jpg
Summary: seven-swans-a-swimming


Image search for Eight maids a-milking

Eight_Maids_a_Milking.jpg

Eight_Maids_a_Milking.jpg

URL: http://www.sheridangardens.com/ChristopherRadko/Eight_Maids_a_Milking.jpg
Summary: Eight Maids a Milking


Image search for Nine ladies dancing

nine_ladies_dancing.gif

nine_ladies_dancing.gif

URL: http://www.101funpages.com/html/imgs/page_imgs/images/nine_ladies_dancing.gif
Summary: Two Turtle Doves And a Partridge in a Pear Tree. On the ninth day of Christmas, My true love gave to me,


Image search for Ten lords a-leaping

1993 Ten Lords A-Leaping.JPG

1993 Ten Lords A-Leaping.JPG

URL: http://www.thepartyshop.com/Commerce/images/1993%20Ten%20Lords%20A-Leaping.JPG
Summary: 1993 Springtime Bonn.. 27-Apr-2005 21:40 57K 1993 TURTLE.jpg 14-Jul-2005 08:37 33K 1993 Ten Lords A-Lea.. 26-May-2005 14:53 28K 1993 Time for Easter.. 27-Apr-2005 21:54 100K


Image search for Eleven pipers piping

11pipers.gif

11pipers.gif

URL: http://www.12days.com/graphics/12daysbook/11pipers.gif
Summary: Eleven Pipers Piping ~ C o l l e c t o r s E d i t i o n ~


Image search for Twelve drummers drumming

12drummersdrumming.gif

12drummersdrumming.gif

URL: http://home.netvigator.com/~dianayu/images/12drummersdrumming.gif
Summary: On the twelfth day of Christmas My true love gave to me Twelve drummers drumming Eleven pipers piping,


Download attached file.