[interchange-cvs] interchange - heins modified code/UserTag/fortune.tag

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Sun Aug 24 15:53:00 EDT 2003


User:      heins
Date:      2003-08-24 18:53:05 GMT
Modified:  code/UserTag fortune.tag
Log:
* Add "no-computer" option to make the fortune more palatable to non-geek
  sites.

  This is highly dependent on the fortune setup; this will work with
  fortune on RHL 7.x and 8.x.

Revision  Changes    Path
1.3       +28 -5     interchange/code/UserTag/fortune.tag


rev 1.3, prev_rev 1.2
Index: fortune.tag
===================================================================
RCS file: /var/cvs/interchange/code/UserTag/fortune.tag,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- fortune.tag	30 Oct 2002 20:43:05 -0000	1.2
+++ fortune.tag	24 Aug 2003 18:53:05 -0000	1.3
@@ -4,14 +4,16 @@
 
 =pod
 
-This tag uses the fortune(1) command to display a randome saying.
+This tag uses the fortune(1) command to display a random saying.
 
 Options:
 
-	short=yes|no* Select only short (< 160 chars) fortunes
-	a=1           Select from all fortunes, even potentially offensive ones.
-	o=1           Select only from potentially offensive fortunes.
-	raw=1         Don't do any HTML formatting
+    short=yes|no*       Select only short (< 1
+		60 chars) fortunes
+    no-computer=yes|no* No computer fortunes.
+    a=1                 Select from all fortunes, even potentially offensive ones.
+    o=1                 Select only from potentially offensive fortunes.
+    raw=1               Don't do any HTML formatting
 
 Example:
 
@@ -29,6 +31,27 @@
 	push @flags, '-s' if is_yes($short);
 	for(grep length($_) == 1, keys %$opt) {
 		push @flags, "-$_" if $opt->{$_};
+	}
+
+	if(is_yes($opt->{no_computer}) ) {
+     	push @flags, qw/
+			6% education 
+			6% food 
+			6% humorists 
+			6% kids 
+			6% law 
+			6% literature 
+			6% love 
+			6% medicine 
+			6% people 
+			6% pets 
+			6% platitudes 
+			6% politics 
+			6% science 
+			6% sports 
+			6% work
+			10% wisdom
+		/;
 	}
 
 	my $out = '';







More information about the interchange-cvs mailing list