Last active
August 29, 2015 14:00
-
-
Save bentglasstube/d09bb4b75151c4d0d794 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 strict; | |
use warnings; | |
use vars qw($VERSION %IRSSI); | |
$VERSION = '1.0'; | |
%IRSSI = ( | |
authors => 'Alan Berndt', | |
contact => '[email protected]', | |
description => 'Automatically opens links for lazy turds', | |
license => 'MIT', | |
name => 'autolinks', | |
url => 'https://gist.github.com/bentglasstube/d09bb4b75151c4d0d794', | |
); | |
sub privmsg { | |
my ($server, $data, $nick, $address) = @_; | |
my ($target, $text) = split / :/, $data, 2; | |
system('xdg-open', $1) while $text =~ m{(https?://\S+)}gc; | |
} | |
Irssi::signal_add('event privmsg' => 'privmsg'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment