View Single Post
Old 03-30-2008, 07:04 PM   #23
cen
Connoisseur
cen doesn't littercen doesn't litter
 
Posts: 53
Karma: 140
Join Date: Mar 2008
Device: iRex iLiad (v1) / Sony Librie
Quote:
Originally Posted by carandol View Post
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
Attached Files
File Type: zip Guardian24-2.zip (5.4 KB, 453 views)

Last edited by cen; 03-31-2008 at 03:15 AM. Reason: removed OSX cruft from .zip
cen is offline   Reply With Quote