img-save.pl: fix typos, now it actually downloads links
This commit is contained in:
@@ -10,7 +10,7 @@ sub logger($);
|
|||||||
my $HTINY = undef;
|
my $HTINY = undef;
|
||||||
my $HTINYS = undef;
|
my $HTINYS = undef;
|
||||||
my $DEBUG = 0;
|
my $DEBUG = 0;
|
||||||
my $mc = '127.0.0.1:11211';
|
my $mc = '127.0.0.1:11212';
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
require HTTP::Tiny; # stock perl module, but some assholes from debian rip perl into modules,
|
require HTTP::Tiny; # stock perl module, but some assholes from debian rip perl into modules,
|
||||||
@@ -92,13 +92,13 @@ if (($HTINY == 0) or ($HTINYS == 0)) {
|
|||||||
# print "* wget detected at $wgetpath.\n";
|
# print "* wget detected at $wgetpath.\n";
|
||||||
|
|
||||||
while ( 1 ) {
|
while ( 1 ) {
|
||||||
my $memd = new Cache::Memcached { 'servers' => [ "$mc" ] };
|
my $memd = new Cache::Memcached { 'servers' => [ $mc ] };
|
||||||
my $itemref = $memd->stats(['items']);
|
my $itemref = $memd->stats(['items']);
|
||||||
|
|
||||||
if (defined($itemref->{'hosts'}->{'$mc'}->{'items'})
|
if (defined($itemref->{'hosts'}->{$mc}->{'items'})
|
||||||
and (length($itemref->{'hosts'}->{'$mc'}->{'items'}) > 2)) {
|
and (length($itemref->{'hosts'}->{$mc}->{'items'}) > 2)) {
|
||||||
|
|
||||||
foreach my $stat (split("\n", $itemref->{'hosts'}->{'$mc'}->{'items'})) {
|
foreach my $stat (split("\n", $itemref->{'hosts'}->{$mc}->{'items'})) {
|
||||||
my $slab;
|
my $slab;
|
||||||
my $itemsamount;
|
my $itemsamount;
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ while ( 1 ) {
|
|||||||
my $cachedump = $memd->stats(["cachedump $slab $itemsamount"]);
|
my $cachedump = $memd->stats(["cachedump $slab $itemsamount"]);
|
||||||
my @keys = map {
|
my @keys = map {
|
||||||
(split(/ /))[1];
|
(split(/ /))[1];
|
||||||
} split(/\n/, $cachedump->{'hosts'}->{'$mc'}->{"cachedump $slab $itemsamount"});
|
} split(/\n/, $cachedump->{'hosts'}->{$mc}->{"cachedump $slab $itemsamount"});
|
||||||
|
|
||||||
foreach my $key (@keys) {
|
foreach my $key (@keys) {
|
||||||
if (($key =~ /^irssi_/) or ($key =~ /^xchtlink_/)) {
|
if (($key =~ /^irssi_/) or ($key =~ /^xchtlink_/)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user