diff options
| author | Stefan Heinemann | 2017-01-12 12:37:37 +0100 | 
|---|---|---|
| committer | Stefan Heinemann | 2017-01-12 12:39:50 +0100 | 
| commit | aab7a303ca7743cf58635d5bb2177208acfb97e7 (patch) | |
| tree | bd9b83e368340f32cff0ce3cdaeb0049634504e2 | |
| parent | 2da775d73053a7ba27d9fb228485e95b62f9881b (diff) | |
| download | scripts.irssi.org-aab7a303ca7743cf58635d5bb2177208acfb97e7.tar.bz2 | |
Simple script that just highlights URLs in public messages
| -rw-r--r-- | scripts/hilite_url.pl | 28 | 
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/hilite_url.pl b/scripts/hilite_url.pl new file mode 100644 index 0000000..11c4b0d --- /dev/null +++ b/scripts/hilite_url.pl @@ -0,0 +1,28 @@ +# Simple script to highlight links in public messages + +use strict; +use vars qw($VERSION %IRSSI); + +# Dev. info ^_^ +$VERSION = "0.1"; +%IRSSI = ( +	authors     => "Stefan Heinemann", +	contact     => "stefan.heinemann\@codedump.ch", +	name        => "hilite url", +	description => "Simple script that highlights URL", +	license     => "GPL", +	url         => "http://senseless.codedump.ch", +); + +sub hilite_url { +	my ($server, $data, $nick, $mask, $target) = @_; + +	# Add Colours +	$data =~ s/(https?:\/\/[^\s]+)/\e[4;34m\1\e[00m/g; + +	# Let it flow +	Irssi::signal_continue($server, $data, $nick, $mask, $target); +} + +# Hook me up +Irssi::signal_add('message public', 'hilite_url');  | 
