aboutsummaryrefslogtreecommitdiffstats
path: root/hipchat-stfu.pl
diff options
context:
space:
mode:
authorTeddy Wing2015-06-13 22:29:42 -0400
committerTeddy Wing2015-06-13 22:31:40 -0400
commit8746a69bbb79902b6be5fd205efbb5bfc83feed7 (patch)
treedd42ff037ba0e061bcc61091827c707fc75e10c6 /hipchat-stfu.pl
parentcb08043eef542493b460aee0e7fd79acab8139e3 (diff)
downloadirssi-hipchat-stfu-8746a69bbb79902b6be5fd205efbb5bfc83feed7.tar.bz2
Checking for empty messages from HipChat (WIP)
Some trial and error in selecting the blank empty messages coming from HipChat/JIRA. Had to do the output-to-file thing again, this time a new different one. Was trying to match against an empty string message but it turns out the empty messages that HipChat sends have a single space in them, aggh!
Diffstat (limited to 'hipchat-stfu.pl')
-rw-r--r--hipchat-stfu.pl35
1 files changed, 26 insertions, 9 deletions
diff --git a/hipchat-stfu.pl b/hipchat-stfu.pl
index 1145891..41abb7f 100644
--- a/hipchat-stfu.pl
+++ b/hipchat-stfu.pl
@@ -16,15 +16,32 @@ $VERSION = '1.00';
sub hipchat_stfu {
my ($server, $text, $nick) = @_;
- my $filename = 'hipchat-stfu-output.txt';
- open(my $fh, '>>', $filename) or die;
- print $fh Dumper($server);
- print $fh "\t";
- print $fh $text;
- print $fh "\t";
- print $fh $nick;
- print $fh "\n";
- close $fh;
+ # my $filename = 'hipchat-stfu-output.txt';
+ # open(my $fh, '>>', $filename) or die;
+ # print $fh Dumper($server);
+ # print $fh "\t";
+ # print $fh $text;
+ # print $fh "\t";
+ # print $fh $nick;
+ # print $fh "\n";
+ # close $fh;
+
+ if ($server->{'chatnet'} eq 'Bitlbee' &&
+ $nick eq 'root') {
+ open(my $fh, '>>', 'hipchatyeehaw.txt') or die;
+ # print $fh 'yeehaw' if ($text eq '');
+ # print $fh 'boohoo' if (!defined($text));
+ print $fh 'booya' if ($text =~ /^\s*$/);
+ # print $fh $text . "\n";
+ close $fh;
+
+ if ($text eq '') {
+ signal_stop();
+ }
+ else {
+ # Modify the text
+ }
+ }
};
signal_add {