--- /dev/null
+#!/usr/local/bin/perl -w
+
+use strict;
+$| = 1;
+
+# Directory to find images in
+my($dir) = "/web/i-scream/nwww/logos";
+# Pattern to match images - remember to escape
+my($pattern) = "\\.jpg\$";
+
+# URL to images - must match $dir
+my($url) = "http://nwww.i-scream.org/logos";
+
+# Where the setbg command is
+my($setbg) = "/web/i-scream/nwww.bin/setbg.pl";
+
+# Code...
+my($imagepath) = `$setbg -r -p \'$pattern\' -b echo -f \' \' $dir`;
+chomp $imagepath;
+$imagepath =~ s/$dir/$url/;
+
+print "Content-type: text/plain\n\n";
+print $imagepath;
+
+exit 0;