Skip to content

Instantly share code, notes, and snippets.

@xsawyerx
Last active August 29, 2015 14:12
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xsawyerx/cff74599de34da794f6d to your computer and use it in GitHub Desktop.
Save xsawyerx/cff74599de34da794f6d to your computer and use it in GitHub Desktop.
#!perl
use strict;
use warnings;
use IO::All;
use IO::All::LWP;
use Web::Query;
local $| = 1;
wq('http://podbay.fm/show/536258179')
->find('table.table-striped > tbody > tr')
->each( sub {
my $title = wq($_)->find('td > a')->first->text;
print "Fetching episode: $title... ";
my $filename = "$title.mp3";
if ( -e $filename ) {
print "already exists.\n";
return;
}
my $episode_href = wq($_)
->find('td > a.btn')
->first->attr('href');
my $download_href = wq($episode_href)
->find('div #download > a.btn')
->attr('href');
io($download_href) > io($filename);
print "done.\n";
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment