wordcounter - an application built using Navegante
Build the application:
$ navegante examples/wordcounter
Use the newly created file wordcounter as a CGI.
This application behaves as a CGI and it counts the words being in the content being browsed. On every request we are using the live feedback option of our application banner to print the number of browsed words. Also, we are keeping track of the total of words being counted, we print this information when the user quits the application. The specific DSL section is:
cginame(./wordcounter) formtitle(Word Counting Tool) proc(wcFunction) desc(wcDesc) init(wcInit) livefeedback(wcLive) quit(wcQuit)
$currentThis variable is used to keep count of words in every request.
wcDescThis function is prints the description of the create application. This
is defined in the DSL by the desc statement.
wcFunctionThis is the function that actually counts the number of words. This
is defined in the DSL by the proc statement.
XXX - _loadit
wcLiveThis is the function that prints the HTML that feeds the banner section
for reporting information. This is defined in the DSL by the
livefeedback statement.
wcInitThis function runs on the beginig of every request and it's used here
to reset the word counter. This is defined in the DSL by the init
statement.
wcQuitThe function that is called when the user follows the link to
leave the application. This is defined in the DSL by the
quit statement.
Nuno Carvalho, smash@cpan.org
TODO