Skip to content

Instantly share code, notes, and snippets.

@freddiefujiwara
Created January 30, 2011 07:16
Show Gist options
  • Save freddiefujiwara/802644 to your computer and use it in GitHub Desktop.
Save freddiefujiwara/802644 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use strict;
use warnings;
my $flickrRss = $ARGV[0] or die $!;
my $photoNo = 1;
open(RSS,"curl '$flickrRss' | grep jpg | sed 's/.*http/http/g' | sed 's/jpg\".*\$/jpg/g' | grep -v m.jpg |") or die $!;
while(<RSS>){
chomp;
if($_ =~ /o.jpg/){
system("curl $_ > res/drawable-hdpi/".sprintf("image_%03d.jpg",$photoNo));
}elsif($_ =~ /s.jpg/){
system("curl $_ > res/drawable-hdpi/".sprintf("s_image_%03d.jpg",$photoNo));
$photoNo++;
}
}
close(RSS);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment