Does anyone know of a javascript code that I can add to a wordpress blog that would scrape flickr based upon keyword/keywords and result in a defined number of images based upon that keyword.

If I had a blog with 1,000 posts around the keyword drugs. I would like for each post to have a separate image based on the keyword "drugs".

Can that be done.