View Single Post
Old 03-28-2008, 05:42 PM   #11
cen
Connoisseur
cen doesn't littercen doesn't litter
 
Posts: 53
Karma: 140
Join Date: Mar 2008
Device: iRex iLiad (v1) / Sony Librie
Problem solved, assuming you had the same issue as me. The script fails if /media/cf/newspapers/Guardian24/ doesn't exist (and I never bothered to create it as I put the script elsewhere )

Updated code to create the root newspaper dir if it doesnt exist (mkdir -p)
To get the wifi working:
uncomment the following lines
#/usr/bin/wireless.sh start <SSID> <ENC_TYPE> <PASS>
#/usr/bin/wireless.sh stop

and replace <...> with your wifi details.

Code:
#!/bin/sh
export GUARDIAN_PATH=/media/cf/newspapers/Guardian24/
/usr/bin/wired.sh start
#/usr/bin/wireless.sh start <SSID> <ENC_TYPE> <PASS>
rm -rf $GUARDIAN_PATH/Guardian.pdf
mkdir -p $GUARDIAN_PATH/Guardian.pdf
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?><package><metadata><dc-metadata><Title>The Guardian 24h edition</Title><Description>Downloaded: `echo \`date\``</Description></dc-metadata><y-metadata><startpage>Guardian.pdf</startpage><image>icon.png</image><version>000</version></y-metadata></metadata></package>" > $GUARDIAN_PATH/Guardian.pdf/manifest.xml
wget -O $GUARDIAN_PATH/Guardian.pdf/Guardian.pdf http://download.guardian.co.uk/g24/World.pdf
cp $GUARDIAN_PATH/get-guardian/icon.png $GUARDIAN_PATH/Guardian.pdf/icon.png
/usr/bin/wired.sh stop
#/usr/bin/wireless.sh stop

edit: sort of works, gets to 28% download of the PDF then stalls and craps out (but the PDF is created). YMMV

Last edited by cen; 03-28-2008 at 05:54 PM.
cen is offline   Reply With Quote