1 # Copyright 2002-2007 Interchange Development Group and others
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version. See the LICENSE file for details.
8 # $Id: fortune.tag,v 1.7 2007-03-30 23:40:57 pajamian Exp $
10 UserTag fortune Order short
11 UserTag fortune addAttr
12 UserTag fortune Version $Revision: 1.7 $
13 UserTag fortune Routine <<EOR
15 my ($short, $opt) = @_;
16 my $cmd = $Global::Variable->{MV_FORTUNE_COMMAND} || '/usr/games/fortune';
18 push @flags, '-s' if is_yes($short);
19 for(grep length($_) == 1, keys %$opt) {
20 push @flags, "-$_" if $opt->{$_};
23 if(is_yes($opt->{no_computer}) ) {
45 open(FORT, '-|') || exec ($cmd, @flags);
52 $out = filter_value('text2html', $out);
53 $out =~ s/--(?!:.*--)/<br>--/s;