link_to_memc.pl: added "irssi_" suffix to memcache keys
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user