views:

22

answers:

2

I have an app that processes images. For testing it, I have a script that submits an image. This is not completely uncommon.

I am bored with my test images. Filling up a folder with some images and getting my test script to randomly pick one gets boring really quickly.

Is there any script - in any language, really - that can get a random image from somewhere on the internet?

I started to use the awesome http://www.jwz.org/webcollage/ but the images are too cluttered to scale nicely. Actual photos themselves, and ideally thumbnails and such, would be nicer.

I was hoping that http://code.google.com/p/googlecl/ would have image search, but unfortunately it doesn't.

A: 

Have you tried getting a random Wikipedia page (eg with curl) and checking if it has an image in the article. Alternatively you could try a news site's RSS feed or a flickr feed.

Edit: here's an example script to get a random xkcd iamge:

wget `wget -qO- dynamic.xkcd.com/comic/random  | sed -n 's/<h3>Image URL.*: \(.*\)<\/h3>/\1/p'`
dave1010
+1  A: 

Flickr has a lot of images and a good API.

It shouldn't be too hard to create something that gets random images from flickr. You can even set some tags or groups as starting-point, so you'll get new specific images you like.

More info on flickr's api: http://www.flickr.com/services/api/

There are groups that have random images, so you can just get some images from such a group and display/use those.

Or you can use "flickr.photos.search.html" to get the lastest (500?) images. Once you've processed those you can do another query for latest images. With the API you can even set dimensions etc, if you want specific images.

Roy van Rijn
Also, there is a Javascript implementation of this: http://www.codealias.info/technotes/javascript_for_getting_flickr_images_with_tagsJust enter some tags and get random images.
Roy van Rijn