1

link_to_memc.pl: added "irssi_" suffix to memcache keys

This commit is contained in:
eleksir
2018-03-11 15:45:21 +03:00
parent a8ba6e97d6
commit 6fccf86181

View File

@@ -10,14 +10,14 @@ use vars qw($VERSION %IRSSI);
sub hookfn; sub hookfn;
$VERSION = '1.00'; $VERSION = '1.00a';
%IRSSI = ( %IRSSI = (
authors => 'Eleksir', authors => 'Eleksir',
contact => 'eleksir@exs-elm.ru', contact => 'eleksir@exs-elm.ru',
name => 'Image link saver', name => 'Image link saver',
description => 'Saves image link to memcache', description => 'Saves image link to memcache',
license => 'Public Domain', license => 'BSD',
changed => 'Sun Oct 02 12:21 CET 2016', changed => 'Sun Mar 11 15:39 CET 2018',
); );
@@ -30,7 +30,7 @@ sub hookfn {
foreach (@words) { foreach (@words) {
if ($_ =~ m{:?https?://([a-zA-Z0-9.-]+\.[a-zA-Z]+)/(?:.*)}) { if ($_ =~ m{:?https?://([a-zA-Z0-9.-]+\.[a-zA-Z]+)/(?:.*)}) {
my $memd = new Cache::Memcached { 'servers' => [ "127.0.0.1:11211" ] }; my $memd = new Cache::Memcached { 'servers' => [ "127.0.0.1:11211" ] };
$memd->set(md5_base64($str), $str); $memd->set('irssi_' . md5_base64($str), $str);
$memd->disconnect_all; $memd->disconnect_all;
last; last;
} }