Quote:
Originally Posted by carandol
I've included a few tips in comments in the script for setting it up, with alternate lines for internal memory and MMC card (though not for CF card because it doesn't seem to work).
|
Here is a version with working CF. The script will download news to <media of choice>/newspapers/Guardian24/. All files are downloaded to /tmp on internal memory first then moved to the correct media.
Things to do before running script
1) Uncomment the line for your media of choice
2) If using wifi set the ssid / enc / key
Code:
#!/bin/sh
####
# Uncomment one of the following depending on storage device
#export GUARDIAN_PATH=/media/cf/newspapers/Guardian24 # CF storage
#export GUARDIAN_PATH=/media/card/newspapers/Guardian24 # SD/MMC card
#export GUARDIAN_PATH=/mnt/free/newspapers/Guardian24 # Internal storage
/usr/bin/wired.sh start
/usr/bin/wireless.sh start <SSID> <ENC_TYPE> <KEY>
for i in World Business Media Sport Topstories
do
rm -rf $GUARDIAN_PATH/$i.pdf
mkdir -p $GUARDIAN_PATH/$i.pdf
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?><package><metadata><dc-metadata><Title>The Guardian 24h - $i</Title><Description>Downloaded: `echo \`date\``</Description></dc-metadata><y-metadata><startpage>$i.pdf</startpage><image>icon.png</image><version>000</version></y-metadata></metadata></package>" > $GUARDIAN_PATH/$i.pdf/manifest.xml
wget -O /tmp/$i.pdf http://download.guardian.co.uk/g24/$i.pdf
mv /tmp/$i.pdf $GUARDIAN_PATH/$i.pdf/$i.pdf
cp $GUARDIAN_PATH/get-guardian/icon.png $GUARDIAN_PATH/$i.pdf/icon.png
done
/usr/bin/wired.sh stop
/usr/bin/wireless.sh stop