Tags:
create new tag
, view all tags

FortuneCookiePlugin

Just a placeholder to remind me that I LOVE the fortune program and I SHOULD develop a fortune cookie plugin that:

-- AndreaSterbini - 22 Nov 2001

I felt the same. The result was a mini-plugin (my first plugine experiment ever) which can be used to execute arbitrary CGI scripts from within a TWiki page, using a syntax such as:

%SSIEXEC{cmd="fortune.cgi someargs"}%

As you can see from the syntax, the plugin was inspired by the SSI exec mechanism implemented in many web server.

The plugin is lacking any kind of security checks and is highly dangerous, so I'd rather not post it here. If works fine for us, however, because we're operating it under controlled circumstances. We use the plugin to randomly display famous one-liners from folks in the development team, or sections from the Hacker's Dictionary. If you're interested, let me know.

-- ClausBrod - 03 Mar 2003

Maybe this kind of dangerous behavior could be parametrized not on plugin's page, but by some string variable in plugin source code itself. Ie &EXECKNOWN{"fortune"}%, where "fortune" is a hash key of something which is set in source code. So Admin can easily hack it up, know what is there, and crackers cannot crack in. It will be fun to have Murphy's laws in the header. wink

-- PeterMasiar - 04 Mar 2003

A while back I cobbled together a simple plugin that calls the fortune program and inserts the results in PRE tags. I never bothered to clean it up and share the code but since it seems people are interested I've attached it to this topic. To call it use %FORTUNE%

-- DanBoitnott - 05 Mar 2003

Topic attachments
I Attachment Action Size Date Who Comment
Perl source code filepm FortunePlugin.pm manage 3.1 K 2003-03-05 - 03:22 DanBoitnott Quick and Dirty Fortune Plugin
Texttxt FortunePlugin.txt manage 2.0 K 2003-03-05 - 03:22 DanBoitnott Quick and Dirty Fortune Plugin Topic
Topic revision: r4 - 2003-03-05 - DanBoitnott
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by PerlIdeas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.