Squid Fingers v2
I wanted to change my twitter background image yesterday and recalled how much I love the background images over at squidfingers.
As can be expected, the site was redesigned at some point in the past 3'ish years. The redesign broke my script as the image names/locations changed.
The newly modified perl script can be found here.
#!/usr/bin/perl use strict; use LWP::Simple 'getstore';# squidfingers.pl - will willis - 05/28/2008
# a script to download groovy background images like:
# http://squidfingers.com/assets/patterns/pattern_028.gif
my $count = 1; # to iterate over images
my $error = 0; # count failed requests
my $give_up = 5; # when we've probably run out of images
while (1) {
download_bg($count) || $error++;
last if $error > $give_up;
$count++;
}sub download_bg {
my $num = sprintf("%03d",shift);
my $url = "http://squidfingers.com/assets/patterns/pattern_$num.gif";
my $response = getstore($url,"$num.gif");
return ($response eq '200') ? 1 : 0;
}



Leave a comment