docker-buttbot/butt

33 lines
661 B
Plaintext
Raw Permalink Normal View History

#!/usr/bin/env perl
use strict;
use warnings;
2009-11-10 07:18:52 -08:00
BEGIN {
2009-11-10 07:20:50 -08:00
use FindBin qw($RealBin);
push @INC, $RealBin;
2009-11-10 07:18:52 -08:00
}
use Butts;
my $butt = $ARGV[0] // "butt";
2009-11-10 06:54:45 -08:00
my $replace_freq = $ARGV[1] // (1/11);
my $debug = $ARGV[2] // 0;
my $buttifier = Butts->new(meme => $butt,
debug => $debug,
replace_freq => $replace_freq);
print STDERR "$butt repeat rate is " . $buttifier->replace_freq . $/
if $debug;
2009-10-27 10:17:48 -07:00
while(<STDIN>) {
# The old way
# chomp
# print join(" ", $buttifier->buttify(split(/\s+/, $_)))."\n";
# The new way
print $buttifier->buttify_string, $/;
}