Created
February 12, 2018 00:05
-
-
Save colomon/4d4761d55d11ff7491cbc65a5193204d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
use v6; | |
use LibCurl::Easy; | |
for $*IN.comb(/ <?after 'href="'> (<-["]>+ ['mp3' | 'pdf']) /) -> $url { | |
if $url ~~ m{ ^ 'http://www.buddhistbassoonquartet.org/' (.*) } { | |
my $filename = $0.subst('%20', '_', :global).IO; | |
my $dirname = $filename.dirname.IO; | |
unless $dirname.e { | |
$dirname.mkdir; | |
} | |
LibCurl::Easy.new(URL => $url, | |
download => ~$filename).perform; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment