Skip to content

Instantly share code, notes, and snippets.

@yusukebe
Created August 11, 2009 18:55
Show Gist options
  • Select an option

  • Save yusukebe/166056 to your computer and use it in GitHub Desktop.

Select an option

Save yusukebe/166056 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use Imager;
use LWP::UserAgent;
use WWW::Favicon;
my $favicon = WWW::Favicon->new;
my $favicon_url = $favicon->detect('http://yusukebe.com/');
my $ua = LWP::UserAgent->new;
my $res = $ua->get( $favicon_url );
my $img = Imager->new;
$img->read( data => $res->content );
$img->write( file => 'favicon.gif' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment