On Oct 17, 2005, at 7:11 PM, Robert Citek wrote:

I refactored some more:


If you make two assumptions ( 1) folders will not have non- alphanumeric characters and 2) URLs will not have non-alphanumeric characters) then you can simplify the bp.conf file by separating the folder and URL with a tab or space. That then also simplifies the code:

#!/bin/bash
[ -d All_M3U ] || mkdir All_M3U
# Read the bp.conf file and wget any url not already in the podcast.log file:
cat bp.conf |
while read datadir podcastURL ; do
wget -q $podcastURL -O - | tr '\r' '\n' | tr \' \" | sed -n 's/.*url="\([^"]*\)".*/\1/p' |
        while read url ; do
                grep -q "$url" podcast.log && continue
                test -d $datadir || echo mkdir $datadir
                echo wget -q -P $datadir "$url"
                printf "../%s/$s\n" $datadir ${url##*/} |
tee -a All_M3U/${datadir}.m3u >> All_M3U/$(date +% Y-%m-%d).m3u
        done
done

Now on to the logs.

Regards,
- Robert
http://www.cwelug.org/downloads
Help others get OpenSource software.  Distribute FLOSS
for Windows, Linux, *BSD, and MacOS X with BitTorrent



_______________________________________________
CWE-LUG mailing list
[email protected]
http://www.cwelug.org/
http://www.cwelug.org/archives/
http://www.cwelug.org/mailinglist/

Reply via email to