Jump to content
EGGTCL

bash.org-1.4.7.tcl 1.0.0

   (0 reviews)

About This File

HOW IT WORKS

If you want to get on and configure the damn thing, skip this
section.

The random quote function was the first written. It makes
an HTTP query to the 'Random' link on the bash.org front page.
It receives the response and then uses various regexp filters
to extract the quotes and place them in a TCL list (bash_cache).
Meanwhile the numbers of the quotes are stored in another list
(bash_number_list). The position of the next item that is
to be displayed from these lists is marked by the
bash_cache_pointer_position variable. Requesting quotes is
disabled when the cache is empty and, if not already running,
an HTTP query is attempted to refill the cache. The cache will
also be refilled when the pointer hits the end of the list.
When a quote is requested, bash_cache[bash_cache_pointer_position]
and bash_number_list[bash_cache_pointer_position] are read,
the pointer is incremented, and the resulting texts are again
regexp filtered by the bash_output function for de-escaping of
HTML entities (  etc). If the length of the quote exceeds
bash_max_public_line_length, the pointer is repeatedly
incremented until this condition is not true. If
bash_max_public_line_length is set low, only a few quotes will
be displayed by this command per HTML query.
The TCL commands to display the quote in the channel are placed
on the event queue with the 'after' command and told to execute
a certain time apart (this time being set by the
bash_seconds_per_line setting). 


User Feedback

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
×
×
  • Create New...