Last active
August 29, 2015 14:12
-
-
Save xsawyerx/cff74599de34da794f6d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!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