Introduce config support, rename fortune.pm to easter_egg.pm
This commit is contained in:
29
lib/easter_egg.pm
Normal file
29
lib/easter_egg.pm
Normal file
@@ -0,0 +1,29 @@
|
||||
package easter_egg;
|
||||
|
||||
use strict;
|
||||
use warnings "all";
|
||||
use vars qw/$VERSION/;
|
||||
|
||||
$VERSION = "1.0";
|
||||
|
||||
sub quote {
|
||||
if (-f "/usr/games/fortune") {
|
||||
return ('200', 'text/plain', `fortune`);
|
||||
} else {
|
||||
return ('200', 'text/plain', "No fortune here!\n");
|
||||
}
|
||||
}
|
||||
|
||||
sub chanserv {
|
||||
return ('200', 'text/plain', "There is no conserves here.\n");
|
||||
}
|
||||
|
||||
sub nickserv {
|
||||
return ('200', 'text/plain', "Nick is out, please come back later.\n");
|
||||
}
|
||||
|
||||
sub me {
|
||||
return ('200', 'text/plain', "Who?\n");
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -1,12 +0,0 @@
|
||||
package fortune;
|
||||
|
||||
use strict;
|
||||
use vars qw/$VERSION/;
|
||||
|
||||
$VERSION = "1.0";
|
||||
|
||||
sub quote {
|
||||
return ('200', 'text/plain', `fortune`);
|
||||
}
|
||||
|
||||
1;
|
||||
Reference in New Issue
Block a user