Skip to Content
Podcasting Hacks
book

Podcasting Hacks

by Jack D. Herrington
August 2005
Beginner
464 pages
12h 36m
English
O'Reilly Media, Inc.
Content preview from Podcasting Hacks

Convert Text-Based Blogs into Podcasts

Use the speech synthesizer on the Macintosh to turn text RSS feeds into podcasts and import them into iTunes.

If you get addicted to podcasts, you will find yourself wishing that your regular feeds were podcasts. However, those feeds are in text. Short of getting someone to read them, how do you get them into audio? You can use a speech synthesizer that turns the text into speech.

It might not be the most pleasant way to listen to text, but if you are at the gym and you want to get the latest technology headlines, you can use a speech synthesizer to read the headlines into MP3 files for iTunes [Hack #4] .

The Code

Save this code as asmac.pl:

    #!/usr/bin/perl -w
    use LWP::Simple;
    use FileHandle;
    use Cwd;
    use strict;

    # The URL of the RSS feed

    use constant URL => "http://www.mysite.com/myrss.xml";

    # The artist name for the MP3s

    use constant ARTIST => "Artist Name";

    # The album name of the MP3s

    use constant ALBUM => "Album Name";

    # The output directory to put the MP3s into

    use constant OUTPUT_DIR => "mp3s"; # Gets the feed and returns a hash of the RSS items, their titles # and the temporary filenames sub get_feed($) { my $out = {}; my $text = get URL; while( $text =~ /\<item(.*?)\<\/item\>/gs ) { my $item = $1; my ( $title ) = $item =~ /\<title\>(.*?)\<\/title\>/gs; my ( $desc ) = $item =~ /\<description\>(.*?)\<\/description\>/gs; $title =~ /[\n|\r]/g; $desc =~ s/[\n|\r]/ /g; $desc =~ s/$\<\!\[CDATA\[//; $desc =~ s/\]\]\>//; $desc =~ s/\<.*?\>//g; ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Tricks of the Podcasting Masters

Tricks of the Podcasting Masters

Robert Walch, Mur Lafferty
Secrets of Podcasting

Secrets of Podcasting

Bart G. Farkas
Absolute Beginner’s Guide to Podcasting

Absolute Beginner’s Guide to Podcasting

George Colombo, Curtis Franklin Jr.

Publisher Resources

ISBN: 0596100663Catalog PageErrata