Last active
November 11, 2015 02:29
-
-
Save revmischa/62adbb8c02ca85bbffc7 to your computer and use it in GitHub Desktop.
Irssi script to prevent clicking of low-quality links on the internet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use vars qw/$VERSION %IRSSI/; | |
use strict; | |
use warnings; | |
$VERSION = '0.01'; | |
%IRSSI = ( | |
authors => 'revmischa', | |
name => "shitlink", | |
description => 'Prevents visiting of shit links', | |
license => "BSD", | |
); | |
# Bindings | |
Irssi::signal_add_last( 'message public', \&event_public ); | |
sub event_public { | |
my ($server, $text, $nick, $addr, $target) = @_; | |
if ($nick =~ /giraffe/i) { | |
$text =~ s!(https?://[^\s]+)!<SHIT LINK BLOCKED>!ig; | |
} | |
Irssi::signal_continue($server, $text, $nick, $addr, $target); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment