Skip to content

Instantly share code, notes, and snippets.

@paveljurca
Last active November 20, 2017 21:06
Show Gist options
  • Save paveljurca/a6003b8378aa19d438cb to your computer and use it in GitHub Desktop.
Save paveljurca/a6003b8378aa19d438cb to your computer and use it in GitHub Desktop.
download the podcast mp3s from given simplecast.fm
use strict;
use warnings;
use LWP::UserAgent;
use HTTP::Request::Common;
use constant API
=> 'http://simplecast.fm/podcasts/1446/rss';
my @html = split m|<title>|,
LWP::UserAgent->new->request(GET API)->decoded_content;
# cut the first odd and heading
for (@html[3..$#html]) {
my ($title) = m|^([^<]+)|;
my ($url) = m|<enclosure url="([^"]+)|;
$title =~ s/Chapter //;
# system "wget", $url, "-O", "/home/pavel/Downloads/Marketing_for_Developers/mp3/$title.mp3";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment