#!/bin/sh # (C)opyleft DG6FL Gerolf Ziegenhain 2010 # Released under GPLv2 PTH=$PWD for wpm in 5 10 13 15 18 20 25 30 35 40; do DIR=${wpm}wpm FEED=index.html echo Processing $DIR ... [[ -e $DIR ]] || mkdir $DIR # Download and tag mp3s cd $DIR #wget --no-parent --accept txt,mp3 --no-directories --mirror http://www.arrl.org/w1aw/morse/Archive/${wpm}%20WPM%20files/ # Create feed cat << eof > $FEED ARRL CW Training Files @${wpm}wpm This is a podcast for using the latest W1AW Code Practice Files at the speed of ${wpm}wpm in mp3 format, which can be found here: http://www.arrl.org/w1aw/morse.html. The files are copyrighted by the ARRL and this podcast only provides links to them. You can find the script used to create this podcast here. http://rss.ziegenhain.com/cw-arrl/$DIR $(date) http://rss.ziegenhain.com/cw-arrl/cover.jpg Samuel Morse http://rss.ziegenhain.com/cw-arrl/$DIR Feed provided by DG6FL Gerolf Ziegenhain. DG6FL Gerolf Ziegenhain dg6fl@arrl.net Fun ARRL CW Training Files @${wpm}wpm DG6FL Gerolf Ziegenhain ARRL en No eof nfiles=$(ls -la *mp3 |sort -k 6 |awk 'NF>3' | wc -l) for i in $(seq 1 $nfiles); do echo -ne "."; done; echo -ne "\r"; i=1 for f in *mp3; do echo -ne "o" date=$(date -r $f +%Y-%m-%d) year=$(date -r $f +%Y) textfile=${f/WPM.mp3/.txt} text=$(cat $textfile) title=${f/WPM.mp3/} size=$(du $f -b| cut -f 1) url="http://rss.ziegenhain.com/cw-arrl/$DIR/$f" length=$(mp3info -F -x $f 2>&1| awk '/Length/{print$2}') #eyeD3 --remove-all $f 2>/dev/null 1>/dev/null echo -ne "\bO" #eyeD3 --artist="ARRL W1AW Code Practice" --album "${wpm}wpm" --title=$title --track=$i --year=$year --lyrics="english:text:$text" --add-image="$PTH/cover.jpg":FRONT_COVER --comment '(C)opyright ARRL, see http://www.arrl.org/w1aw/morse' $f 2>/dev/null 1>/dev/null echo -ne "\bx" cat << eof >> $FEED $f $url $text ARRL $(echo -ne $date) $url $length ARRL eof i=$(($i+1)) echo -ne "\bX" done cat << eof >> $FEED eof echo done. cp index.html feed.rss cd .. done