View Single Post
Old 10-14-2010, 02:59 PM   #10
plord
Junior Member
plord began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Aug 2010
Device: kindle
Nothing fancy at the moment :-

Code:
#!/ffp/bin/sh

set -e

PATH=/ffp/bin:$PATH
export PATH
TMPDIR=/ffp/tmp
export TMPDIR
RECIPIEHOME=/ffp/share/calibre/recipes
DESTDIR=/mnt/HD_a2/Media/Books/Periodicals
FROM=xxxx@x.com
TO=yyyy@free.kindle.com

# what to fetch on each day
#
daily="dilbert"
Monday="teleread"
Tuesday="new_scientist"
Wednesday=""
Thursday="lwn"
Friday="linux_magazine"
Saturday="guardian"
Sunday="wired_uk"

today=$(date +%A)
for feed in ${daily} $(eval echo \${$(date +%A)})
do
        extras=""
        if [ "$feed" == "lwn" ]
        then
                extras="--username=user --password=pass"
        fi
        rm -f ${DESTDIR}/${feed}.mobi
        ebook-convert ${RECIPIEHOME}/${feed}.recipe ${DESTDIR}/${feed}.mobi --output-profile kindle ${extras}
        calibre-smtp --attachment=${DESTDIR}/${feed}.mobi ${FROM} ${TO} ""
        calibredb add ${DESTDIR}/${feed}.mobi -d --library-path ~/calibre
done
plord is offline   Reply With Quote