Standard Mischief

Gun Nuts: TNG podcast with a side order of curl-bash-rss mischief

Just a little something I whipped up one night before the long drive home. Yea, after losing my 5 minute commute, I’m starting to get into pre-recorded talk shows. I’d have started this post a little differently, but 2003 called and they wanted their podcasting howto post back…

Anyway, here it is:

curl -LO $(curl "http://www.blogtalkradio.com/gunnuts.rss"|egrep -o "http://[^ ]*mp3"|uniq|head -1)

The first curl command uses the L option to allow the request to be redirected with a 3XX response code. Blogtalkradio.com does this.

The O option just assigns a filename based on the original rss feed URL (sans path). This works well unless you get someone clueless who names their files like this:

http://www.blogtalkradio.com/MarketTicker/2009/05/18/TBA.mp3

http://www.blogtalkradio.com/MarketTicker/2009/05/11/TBA.mp3

I’m not going to explain the regex and remainder except to say that the -1 can be changed to a higher number to get more shows unless everything goes foobar because Karl named his files with exactly the same name.

Oh, and the files just end up in your current working directory, and you’ll have to get out of it if you want to cleanly unmount your flash card, but you knew that already.

You’ll need to get curl though. N00buntu users could use something like

$ sudo apt-get install curl

but if they really are n00bs they’ll probably use the GUI tool to get the job done, and then never touch the command line and get their podcasts using Amarok or something. Nothing wrong with that, it’s just that you are not the audience I’m writing for. The audience I am writing for will find their way here using the “search engine friendly” URL.

Oh and since I’m new to this podcasting stuff, I have to ask. With the proliferation of mp3 players like the iPod shuffle that don’t have a display, shouldn’t we be starting our broadcasts with “gun nuts #54 for May 27th” instead of “Goooood evening ladies and gentlemen…“? That would allow a user to shuffle through a bunch of shows to easily find the one he has not heard yet. Much nicer if the shows don’t all sound the same until a half a minute in.

Thanks for making my commute a bit more interesting, everyone.

2009-05-28 10:00 by Standard Mischief, Filed under:don't try this at home   No Comments »

Comments

No comments yet.

Leave a comment

(required)

(required)

RSS feed for comments on this post. TrackBack URL

current.png

Powered by WordPress , Theme Ported to Wordpress by Liu Xun. Original Design by Cathayan