Skip to content

Instantly share code, notes, and snippets.

@jadeallenx
Created September 10, 2012 22:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jadeallenx/3694498 to your computer and use it in GitHub Desktop.
Save jadeallenx/3694498 to your computer and use it in GitHub Desktop.
tunes.io downloader oneliner
perl -MMojo::UserAgent -MFile::Path=make_path -C -S -E 'my $ua=Mojo::UserAgent->new; chomp(my $date=`date +%Y%m%d`); my $path=$ENV{HOME} . "/Dropbox/tunes.io/$date"; make_path( $path ); $ua->get("http://tunes.io")->res->dom->html->body->div->ul->find('a')->each( sub { say "Getting " . $_->text; $ua->max_redirects(5)->get($_->{href})->res->content->asset->move_to($path."/".$_->text().".mp3") } )'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment