On Oct 17, 2005, at 5:46 PM, Robert Citek wrote:
On Oct 17, 2005, at 1:45 PM, Ed Howland wrote:
Let me know which is easier. BTW, the index command returns the
offset
of the '@' in the line. I felt split would work better. This in
similar
in both perl and ruby.
Here's a stripped-down version that gets the list of mp3 files:
I refactored some more:
#!/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 podcast ; do
number=$(expr "$podcast" : '[EMAIL PROTECTED]@')
podcastURL=${podcast:$number}
wget -q $podcastURL -O - | tr '\r' '\n' | tr \' \" | sed -n
's/.*url="\([^"]*\)".*/\1/p' |
while read url ; do
grep -q "$url" podcast.log && continue
datadir=${podcast:0:$number-1}
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
It doesn't check the logs, yet, but it cleans up the code, especially
that horrendous while loop to get the url file name.
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/