Skip to content

Instantly share code, notes, and snippets.

@colomon
Created Feb 12, 2018
Embed
What would you like to do?
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