[linux-elitists] More crudeness and light

Don Marti dmarti@zgp.org
Tue Oct 25 17:15:11 PDT 2005


begin Teh Entar-Nick quotation of Tue, Oct 25, 2005 at 04:53:44PM -0700:

> So instead of trying to figure out some glob of ruby code that half-does
> what you need, why not just let shell tools do all the work?  here's my
> /usr/local/bin/podcast:
> 
> #!/bin/bash
> wget -O - "$@" | xml2 | grep /enclosure/@url= | cut -d = -f 2 | xargs wget -m
> 
> My crontab then just looks like this:
> 0 3 * * *       cd ~/grabs/ && while read i < feeds; do /usr/local/bin/podcast $i; done

...

> So, who can do me one better?  Better argument handling?

Arguments?  Why not just add the podcasts to your
Planet with all your other RSS feeds, and get the
RSS from the Planet cache:

http://zgp.org/pipermail/linux-elitists/2005-August/011240.html

That way you only have to manage your RSS feeds
in one place, and you can read whatever text was
associated with the audio on your Planet page with
everything else.

> The only thing I actually will change soon is the addition of a -o
> /dev/null or -o /tmp/dlerr.$$ or something.

You might want to take a peek at the MIME type from
the HTTP headers before going ahead with the download.
Some people "enclose" media types you might not want.
See the above script; I'm only grabbing known audio
formats.

Going the other direction, you might want to make
yourself a podcast of a show that's only available
streaming -- for that, check out this article:

"Internet Radio to Podcast with Shell Tools"
http://www.linuxjournal.com/article/8171

-- 
Don Marti
http://zgp.org/~dmarti/
dmarti@zgp.org



More information about the linux-elitists mailing list