[WEB4LIB] RE: Photos on Home Pages

Roy Tennant roy.tennant at ucop.edu
Thu Dec 13 17:18:03 EST 2001


At 11:31 AM -0800 12/12/01, Karen G. Schneider wrote:
>  > have a random image appear on a web page -- any CGI script can do
>>  that, even if the page where the random image appears is static (not
>>  generated by a script)...
>
>To approach this diagnostically, it's my guess that many people
>maintaining library Web pages aren't able to easily/quickly/flexibly
>create, maintain, or update CGI scripts, nor are systems people breaking
>down library doors to breathlessly offer support for these enhancements.
>That isn't to excuse the use of Javascript, only to (possibly and
>partially) explain it.  The appeal of client-side is you can do it
>without begging and/or banging your head on the wall.

Karen is exactly, and rather unfortunately, correct. But it has long 
bothered me that the solution to this issue, which seems to crop up 
on a regular basis, is really quite simple. So I decided to take 30 
minutes and solve it. The result is a script that ANYONE can use, 
without knowledge of Perl, without access to the server, without 
anything except the smarts to follow a pattern in constructing a URL. 
If that is you, read on.

The deal is this. You make all the images that you want to appear in 
a random pool, and put them in the same location on your server 
(anywhere that is web-accessible). Then, wherever you want such an 
image to display, on a random rotation, you drop an image tag as 
specified by this page:

http://sunsite.berkeley.edu/cgi-bin/random.pl

Voila! Random images for the masses. Yes, you are dependent on a 
remote server, but it is better than being dependent on Javascript. 
Consider this a service of Web4Lib.
Roy


More information about the Web4lib mailing list