How to get a fortune from the eldar.org fortune server

How to get a fortune from the eldar.org fortune server


NEW Version 2.0 is now available.

It is quite simple to get a fortune for the eldar.org fortune server. One simply includes the following URL at the correct spot:

http://anduin.eldar.org/cgi-bin/fortune.pl

There are a number of arguments which might prove to be useful:

So... something like:

http://anduin.eldar.org/cgi-bin/fortune.pl?fortune_db=pratchett&background=transparent

.... or ....

http://anduin.eldar.org/cgi-bin/fortune.pl?fortune_db=pratchett&text_format=yes&preformat_text=yes

.... or ....

http://anduin.eldar.org/cgi-bin/fortune.pl?fortune_db=pratchett&background=red&foreground=yellow

.... or ....

http://anduin.eldar.org/cgi-bin/fortune.pl?fortune_db=pratchett&background=transparent&foreground=white

would return a Terry Pratchett fortune. Of course, if one chooses the non-text format, one can also include the above URL into an IMG SRC tag, like the following. This is probably the simplest method for including a fortune along with other content in a web page:

The max_lines argument will try 15 times to acquire a fortune that is less then or equal to the number of lines desired. If it can not get a fortune that fits, it will return a fortune that is longer.

The text_format option will return the fortune as ASCII text. This is generally not useful directly in a web page, unless the fortune is processed in another way, say via a CGI script. About the only other way to use this option would be as the URL src for a Netscape 4.x LAYER or a CSS2/Internet Explorer 5.x IFRAME. The color options are ignored when the fortune is returned as text.

The preformat_text option will encase the fortune in a HTML PRE block automatically. This is only meaningful when the fortune is returned as text.