Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mattn/83991 to your computer and use it in GitHub Desktop.
Save mattn/83991 to your computer and use it in GitHub Desktop.
From c17c24c9308712a111921f1e2ce034b6861beb81 Mon Sep 17 00:00:00 2001
From: mattn <[email protected]>
Date: Tue, 24 Mar 2009 16:20:03 +0900
Subject: [PATCH] save avatar cache named as URL suffix of image.
---
github-growler.pl | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/github-growler.pl b/github-growler.pl
index 830b1c6..fa2b8e2 100755
--- a/github-growler.pl
+++ b/github-growler.pl
@@ -162,7 +162,8 @@ sub get_user {
my $scraper = scraper {
process "#profile_name", name => 'TEXT';
process ".identity img", avatar => [ '@src', sub {
- my $path = "$TempDir/$name.jpg";
+ my $suffix = (split(/\./, $_))[-1];
+ my $path = "$TempDir/$name.$suffix";
LWP::Simple::mirror($_, $path);
return $path;
} ];
--
1.6.2.1217.gd7bc3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment