View Single Post
Old 05-28-2011, 11:30 AM   #1
Junior Member
dunryc began at the beginning.
Posts: 1
Karma: 10
Join Date: May 2011
Device: sony prs-350
guardian newpaper down load script

sorry about the unimpressive post title I got my prs-350 a few weeks ago and thought i would post the script i use to down load the daily guardian newspaper as a pdf.

System is Ubuntu and it requires pdftk to run I would appreciate any comments that would help me improve this little script.

I run this as a cron job every morning Mon to Fri so if my sony is attached it automatically puts the newest version of the guardian on my device so i can read through it on the way to work

regards dunryc

#check if the prs-350 is attached v9a usb
hal-find-by-capability --capability storage | grep Sony_PRS_350 > deviceattached

#check if the file deviceattached is empty if it is then sony reader is not plugged in

if [ -s deviceattached ]; then

echo "found your sony prs-350"
echo "entering directory"
echo " creating pdf "

#create the guauridan pdf

TODAY=`date +%Y_%m_%d`
wget -r -l1 -H -t1 -nd -N -np -A.pdf -erobots=off
pdftk *.pdf cat output guardian
rm *.pdf
mv guardian guardian.pdf
cp -f guardian.pdf /media/READER/database/media/books
rm -f guardian.pdf

dunryc is offline   Reply With Quote