Skip to content

Instantly share code, notes, and snippets.

@stark
Forked from dcat/quote.pl
Created May 5, 2016 16:52
Show Gist options
  • Save stark/222b9a7ec469623069e60f0b7f30f9bd to your computer and use it in GitHub Desktop.
Save stark/222b9a7ec469623069e60f0b7f30f9bd to your computer and use it in GitHub Desktop.
quote.pl for weechat
#!/usr/bin/env perl -w
use strict;
use utf8;
sub quote_cb {
my ($data, $mod, $mod_data, $msg) = @_;
if ($msg =~ /^>/) {
$msg="\x03" . int(rand(15)) . $msg;
}
return $msg;
}
weechat::register("quote.pl", "dcat", "1.1", "beerware", "quote", "", "");
weechat::hook_modifier("input_text_for_buffer", "quote_cb", "");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment