Question
I need a means by which to dynamically include the output of a command (ie: "whois") in a TWiki page.
Is it possible to do this for any shell-level command?
For example, we have a list of domains we own - I'd like to provide a WHOIS output (filtered) on another page when selected.
Environment
--
ForrestAldrich - 19 Jul 2005
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
i think there is a plugin that will allow you do run arbitary shell commands (although this is incredibly insecure).
I think you are best off writing a simple little plugin that will get the call the application that you need...
--
SvenDowideit - 19 Jul 2005
I'm wanting to include the output of the "whois" command on certain domains. Probably parsed, then pretty-printed in TWiki (after I get it working). I don't know perl, but I suppose it's feasible a call to Net::Whois or something might be useful therein.
--
ForrestAldrich - 20 Jul 2005
If there is a web site that provides the output then
NetgrepPlugin might work for you.
--
MartinCleaver - 20 Jul 2005
I know of no website providing free WHOIS queries. Our registrar is joker.com, and I'd like to parse different fields (Expiration, etc) and tabulate those into a formatted table. The one I have is done manually.
--
ForrestAldrich - 20 Jul 2005
Two options:
1. Write an standalone cgi script that returns the whois info, and
%INCLUDE{}% that into your TWiki topic
2. Write a small Plugin, or call a
handleWhois function in the
DefaultPlugin's
commonTagsHandler. Untested code:
$_[0] =~ s/%WHOIS{(.*?)}%/handleWhois($1)/ge;=
The
handleWhois funtions filters the parameter for security, calls
whois and returns the result. Untested code:
sub handleWhois
{
my( $theParams ) = @_;
my $param = TWiki::Func::extractNameValuePair( $theParams );
$param =~ s/[^[a-zA-Z0-9\.]]//g;
my $result = `whois $param`;
# filter result if needed
return $result;
}
You could post a
WhoisPlugin in the
Plugins web if you create the Plugin
--
PeterThoeny - 21 Jul 2005