Shiny New E-Book Gizmo: The Amazon Kindle


View Full Version : The Guardian 24 automatic download


rio
03-27-2008, 04:13 PM
Hi,

I received my iliad this week and started playing a bit with it...
One thing I wanted was to download automatically the 24h pdf edition of the guardian (a UK newspaper), so I wrote a small script that do just that.

The script starts a network connection, delete any previous downloaded pdf, download the last online pdf from the guardian website, create a folder for the iliad, a manifest (to show an icon and the date of the download), and the stop the network connection.

To install this, download the attached zip, decompress it on your MMC card in newspaper, go in the Guardian24 folder, click on the "Guardian UK" item... and it should just work! (of course you need the shell access for that)

If you want to use it elsewhere, you need to edit the run.sh script, and modify the GUARDIAN_PATH variable to point to the location of your choice.

Note that adapting the script to any other resource is trivial, so have fun.

Here is the script itself:

#!/bin/sh
export GUARDIAN_PATH=/media/card/newspapers/Guardian24/
/usr/bin/wired.sh start
/usr/bin/wireless.sh start
rm -rf $GUARDIAN_PATH/Guardian.pdf
mkdir $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

m-reader
03-27-2008, 04:33 PM
Well done mate, if there ever was a reason to install shell access on my iLiad, this is it!

carandol
03-27-2008, 07:39 PM
This is excellent idea, I've been wondering how to download Guardian 24, but lack the programming knowledge...

However, I've given it a go, and there's something not working for me. I changed the path to /media/cf/newspapers/Guardian24/ to suit my iLiad. It seems to go online, and downloads a file with a correct datestamp, but when I try to load the file, the progress bar flashes and then stops with no result. Looking at the file from my linux PC, it shows as an empty file. I've checked my wifi connection, and it's definitely working, I've checked the Guardian 24 file online and it's definitely up, so I don't know what else to try. Any help much appreciated!

rio
03-27-2008, 08:31 PM
However, I've given it a go, and there's something not working for me. I changed the path to /media/cf/newspapers/Guardian24/ to suit my iLiad. It seems to go online, and downloads a file with a correct datestamp, but when I try to load the file, the progress bar flashes and then stops with no result. Looking at the file from my linux PC, it shows as an empty file. I've checked my wifi connection, and it's definitely working, I've checked the Guardian 24 file online and it's definitely up, so I don't know what else to try. Any help much appreciated!

What you describe happens when the file is not downloaded -- the folder and all the rest will still be created by the script, so it /looks/ like it's fine, but there's no content...

My guess is that the iliad did not manage to get an internet connection. I only tried with a wired connection, maybe that's a reason (although it should have worked anyway...).

Are you sure you configured your network connection on the iliad ? If you open mrxvt and type ifconfig what is shown ? and if you then manualltry try to initiate the internet connection (type "/usr/bin/wired.sh start" or /usr/bin/wireless.sh start) what is displayed ?

ksira
03-27-2008, 08:39 PM
Hi, I hope I can help, but I just started playing around with wireless access.

I think you might try and specify the ssid and security when using wireless.sh

edit the run.sh line to:

$/usr/bin/wireless.sh start [network ssid] [encyrption] [key]

BTW the wired version worked fine for me.

carandol
03-28-2008, 07:33 AM
Afraid I don't have mrxvt installed (unless it comes as standard and I've not found it?). But iNewstand is definitely connecting, so it can't be a bad connection. I'll try adding ksira's line to the script, and if/when I have time, I'll look up mrxvt.

carandol
03-28-2008, 07:46 AM
Just tried ksira's line of code, and now it just sits there with the light flashing and the progress bars cycling. Perhaps I got the line wrong. Should it have been:

$/usr/bin/wireless.sh start mynetwork wep 12345678

or

$/usr/bin/wireless.sh start ssid mynetwork encryption wep key 12345678?

cen
03-28-2008, 08:01 AM
Just tried ksira's line of code, and now it just sits there with the light flashing and the progress bars cycling. Perhaps I got the line wrong. Should it have been:

$/usr/bin/wireless.sh start mynetwork wep 12345678

or

$/usr/bin/wireless.sh start ssid mynetwork encryption wep key 12345678?

I believe if you are trying to put this into rio's script you will need to drop the $ and it should be:

/usr/bin/wireless.sh start mynetwork wep 12345678

carandol
03-28-2008, 11:33 AM
Hmm, still no joy.

cen
03-28-2008, 01:22 PM
Hmm, still no joy.

Does it work if you try it wired? This would give us an idea if it's a problem with the script or the wifi connection (via the script)

cen
03-28-2008, 03:42 PM
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.


#!/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

carandol
03-29-2008, 09:01 AM
Still not having any luck. I can't test it wired, because I don't have a network cable. (I mean, what's the point of having a wifi network, then buying wires? :) ) Has anyone else got this to work with wifi?

cen
03-29-2008, 10:38 AM
Not sure how familiar you are with the command line but if you were to fire up a shell on the iLiad and cd into the get-guardian directory and issue the command sh -x run.sh This should give you a better idea of where it is going wrong.

carandol
03-29-2008, 11:14 AM
Well, I'm familiar enough with the shell to do that, but not familiar enough to understand the results! Here's the output:

+ export GUARDIAN_PATH=/media/cf/newspapers/Guardian24/
+ GUARDIAN_PATH=/media/cf/newspapers/Guardian24/
+ /usr/bin/wired.sh start
run.sh: line 3: /usr/bin/wired.sh: No such file or directory
+ /usr/bin/wireless.sh start
run.sh: line 4: /usr/bin/wireless.sh: No such file or directory
+ rm -rf /media/cf/newspapers/Guardian24//Guardian.pdf
+ mkdir /media/cf/newspapers/Guardian24//Guardian.pdf
+++ date
++ echo Sat Mar 29 16:03:30 GMT 2008
+ echo '<?xml version="1.0" encoding="utf-8"?><package><metadata><dc-metadata><Title>The Guardian 24h edition</Title><Description>Downloaded: Sat Mar 29 16:03:30 GMT 2008</Description></dc-metadata><y-metadata><startpage>Guardian.pdf</startpage><image>icon.png</image><version>000</version></y-metadata></metadata></package>'
+ wget -O /media/cf/newspapers/Guardian24//Guardian.pdf/Guardian.pdf http://download.guardian.co.uk/g24/World.pdf
--16:03:30-- http://download.guardian.co.uk/g24/World.pdf
=> `/media/cf/newspapers/Guardian24//Guardian.pdf/Guardian.pdf'
Resolving download.guardian.co.uk... 77.91.249.32
Connecting to download.guardian.co.uk|77.91.249.32|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 255,185 (249K) [application/pdf]

100%[====================================>] 255,185 288.43K/s

16:03:31 (287.81 KB/s) - `/media/cf/newspapers/Guardian24//Guardian.pdf/Guardian.pdf' saved [255185/255185]

+ cp /media/cf/newspapers/Guardian24//get-guardian/icon.png /media/cf/newspapers/Guardian24//Guardian.pdf/icon.png
cp: cannot stat `/media/cf/newspapers/Guardian24//get-guardian/icon.png': No such file or directory
+ /usr/bin/wired.sh stop
run.sh: line 10: /usr/bin/wired.sh: No such file or directory
+ /usr/bin/wireless.sh stop
run.sh: line 11: /usr/bin/wireless.sh: No such file or directory

It's definitely downloading the file, but when I look at it, it's only 8kb and doesn't have the icon attached, just a black rectangle. Hopefully, someone will be able to figure out from this what's not working!

daudi
03-29-2008, 11:39 AM
Just looking at this quickly:

i) Are you sure the manifest file is being created? You do not seem to be directing the output of the echo command to a file. I would have expected to see something like this at the end of the echo command > manifest.xml

ii) You can see that the copy command is failing to find the icon to copy.

Can you look at the CF in a PC? Is it possible that the PDF has been downloaded okay and it in the subdirectory, but because there is no manifest file it won't open?

carandol
03-29-2008, 11:58 AM
Can you look at the CF in a PC? Is it possible that the PDF has been downloaded okay and it in the subdirectory, but because there is no manifest file it won't open?

The manifest file is there, correctly showing when download (supposedly) took place. But the Guardian.pdf is a 0B Empty Document.

Alcuith
03-29-2008, 05:35 PM
The manifest file is there, correctly showing when download (supposedly) took place. But the Guardian.pdf is a 0B Empty Document.

I'm getting exactly the same thing. Icon shows in the Iliad, but blinks and no content.

Just had a look at the card in the PC, manifest file is there but the pdf is 0kb:help:

cen
03-29-2008, 07:04 PM
Made a bit of progress. Looks like the iLiad has a problem writing to my CF card (Transcend 1GB 80x). Changing to internal media (/mnt/free) and the program works fine.

Alcuith are you using CF or other storage? It would be interesting to see if this works for you and carandol if you use internal storage or mmc as rio uses.

Falzon
03-30-2008, 05:15 AM
I had a similar problem running the script - that executed and copied files to CF (PNY OPTIMA 4GB 60x) via wireless.sh start <SSID> wpa <WPA_KEY>
It was going through the motions (flashing green light, folder, manifest and icon created but pdf with 0kb size.)
I used mrxvt to view the executing script and noticed it would STALL during the transfer (varying between 7% and 58% complete) then would time out thus producing the null pdf.

I took the advice of CEN (thanks) and changed the path to the MCC (/media/card/) and it works every time.
The whole transfer takes less then 10 seconds, as opposed to the minute or so it previously took before it would timeout.

I haven't yet tried it with internal memory (/mnt/free/) but guess this would also work.

Can we infer that this may be an issue with wireless transfer of files directly to CF? Probably due to the limited max transfer rate of the CF not keeping up with the wireless transfer rate.
Could faster CF cards work any better I wonder?

carandol
03-30-2008, 07:18 AM
Yay! Success at last! I moved the program to internal memory, added the connection details to the wireless command, and it works perfectly. It must be an issue with the speed of CF cards, as Falzon suggests. :thanks: one and all!

carandol
03-30-2008, 03:09 PM
Now that I've got this working, I've tinkered with the script a bit, so that instead of just downloading the World News, it downloads all the sections of G24; Top Stories, World News, Business News, Media News and Sports News. If you don't want any of the sections, remove (or hash out) the relevant bit of script.

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).

Anyway, here's the code, and the whole thing's zipped below.

#!/bin/sh
export GUARDIAN_PATH=/mnt/free/newspapers/Guardian24 ## for internal memory
#export GUARDIAN_PATH=/media/card/newspapers/Guardian24 ## for MMC card
### Note: doesn't seem to work with CF card
### Connect -- insert details for wireless network
/usr/bin/wired.sh start
/usr/bin/wireless.sh start <SSID> <ENC_TYPE> <PASS>
### Top Stories ###
rm -rf $GUARDIAN_PATH/Topstories.pdf
mkdir $GUARDIAN_PATH/Topstories.pdf
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?><package><metadata><dc-metadata><Title>The Guardian 24h Top Stories</Title><Description>Downloaded: `echo \`date\``</Description></dc-metadata><y-metadata><startpage>Topstories.pdf</startpage><image>icon.png</image><version>000</version></y-metadata></metadata></package>" > $GUARDIAN_PATH/Topstories.pdf/manifest.xml
wget -O $GUARDIAN_PATH/Topstories.pdf/Topstories.pdf http://download.guardian.co.uk/g24/Topstories.pdf
cp $GUARDIAN_PATH/get-guardian/icon.png $GUARDIAN_PATH/Topstories.pdf/icon.png
### World News ###
rm -rf $GUARDIAN_PATH/World.pdf
mkdir $GUARDIAN_PATH/World.pdf
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?><package><metadata><dc-metadata><Title>The Guardian 24h World News</Title><Description>Downloaded: `echo \`date\``</Description></dc-metadata><y-metadata><startpage>World.pdf</startpage><image>icon.png</image><version>000</version></y-metadata></metadata></package>" > $GUARDIAN_PATH/World.pdf/manifest.xml
wget -O $GUARDIAN_PATH/World.pdf/World.pdf http://download.guardian.co.uk/g24/World.pdf
cp $GUARDIAN_PATH/get-guardian/icon.png $GUARDIAN_PATH/World.pdf/icon.png
### Business ###
rm -rf $GUARDIAN_PATH/Business.pdf
mkdir $GUARDIAN_PATH/Business.pdf
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?><package><metadata><dc-metadata><Title>The Guardian 24h Business News</Title><Description>Downloaded: `echo \`date\``</Description></dc-metadata><y-metadata><startpage>Business.pdf</startpage><image>icon.png</image><version>000</version></y-metadata></metadata></package>" > $GUARDIAN_PATH/Business.pdf/manifest.xml
wget -O $GUARDIAN_PATH/Business.pdf/Business.pdf http://download.guardian.co.uk/g24/Business.pdf
cp $GUARDIAN_PATH/get-guardian/icon.png $GUARDIAN_PATH/Business.pdf/icon.png
### Media ###
rm -rf $GUARDIAN_PATH/Media.pdf
mkdir $GUARDIAN_PATH/Media.pdf
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?><package><metadata><dc-metadata><Title>The Guardian 24h Media News</Title><Description>Downloaded: `echo \`date\``</Description></dc-metadata><y-metadata><startpage>Media.pdf</startpage><image>icon.png</image><version>000</version></y-metadata></metadata></package>" > $GUARDIAN_PATH/Media.pdf/manifest.xml
wget -O $GUARDIAN_PATH/Media.pdf/Media.pdf http://download.guardian.co.uk/g24/Media.pdf
cp $GUARDIAN_PATH/get-guardian/icon.png $GUARDIAN_PATH/Media.pdf/icon.png
### Sport ###
rm -rf $GUARDIAN_PATH/Sport.pdf
mkdir $GUARDIAN_PATH/Sport.pdf
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?><package><metadata><dc-metadata><Title>The Guardian 24h Sport News</Title><Description>Downloaded: `echo \`date\``</Description></dc-metadata><y-metadata><startpage>Sport.pdf</startpage><image>icon.png</image><version>000</version></y-metadata></metadata></package>" > $GUARDIAN_PATH/Sport.pdf/manifest.xml
wget -O $GUARDIAN_PATH/Sport.pdf/Sport.pdf http://download.guardian.co.uk/g24/Sport.pdf
cp $GUARDIAN_PATH/get-guardian/icon.png $GUARDIAN_PATH/Sport.pdf/icon.png
### Disconnect
/usr/bin/wired.sh stop
/usr/bin/wireless.sh stop

-Thomas-
03-30-2008, 03:39 PM
Can we infer that this may be an issue with wireless transfer of files directly to CF? Probably due to the limited max transfer rate of the CF not keeping up with the wireless transfer rate.
Could faster CF cards work any better I wonder?
There is a known bug on the iLiad when using WiFi and the CF card at the same time. The transfer rate goes down to ~1kb/s in this case. This isn't specific to any CF brand or model, so exchanging the CF card won't help either.

I think you could enhance the script to download the file to /tmp first and move it to the CF card afterwards...

cen
03-30-2008, 06:04 PM
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


#!/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

carandol
03-31-2008, 06:57 AM
Thanks cen! I knew there had to be a more elegant way of doing that, but I've not done any scripting since I stopped using DOS in the early '90s, so I was pleased I'd got it working at all :)

DiaLogical
03-31-2008, 02:29 PM
Hi guys, I recently got an iLiad myself and it's great to see all kind of user created content. And this one in particular has me very interested. Since I didn't have a problem with other 3th party progs like the browser, reader(s), etc and the code seems clean I didn't expect any now either. But for some reason it doesn't seem to actually create or rather get the required .pdf file.

In short this is all I did;

extracted the latest .zip folder on my iLiad's internal memory in the newspaper folder (icon, manifest and run file)
changed the following to the run file (see quote below; uncomment + wireless info)
Selected the Guardian UK run file on the iLiad, it gives the blinking loading bar, after say 10 seconds the screen renews and nothing happened or opened. No .pdf file (not even a 0 kb) either.

The information about my wireless network is definitely correct, that's for the wep key and the SSID name, the ENC_TYPE is 128bit wep so I filled in <wep> lowercase, which should be fine as well I guess.

Any idea what could be the problem here? Thanks in advance.

#!/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 <mynetworkSSIDname> <wep> <WEP0EX1AM2PL3E>

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

cen
03-31-2008, 03:46 PM
replace:

/usr/bin/wireless.sh start <mynetworkSSIDname> <wep> <WEP0EX1AM2PL3E>

with

/usr/bin/wireless.sh start mynetworkSSIDname wep WEP0EX1AM2PL3E

Probably should have made it clearer that the everything between and including the < > need to be replaced.

DiaLogical
03-31-2008, 04:09 PM
That did the trick indeed, and now it sounds like a stupid mistake)
Thanks a bunch, appreciate the quick reply!

One more question, the font of the Guardian pdf files seems to be rather on the small side. Is there another quick way to enlarge them a few points instead of manually zooming with the iLiad's build in function every time?

carandol
03-31-2008, 05:05 PM
That did the trick indeed, and now it sounds like a stupid mistake)
Thanks a bunch, appreciate the quick reply!

Well, I looked at your code and couldn't see what was wrong with it either, until cen pointed it out :smack:


One more question, the font of the Guardian pdf files seems to be rather on the small side. Is there another quick way to enlarge them a few points instead of manually zooming with the iLiad's build in function every time?

I think the short answer to that is no. The limitation of PDF files is that they're meant to be displayed exactly as the layout was designed. You can zoom in, but you can't alter the font size. It's either zoom in or buy a magnifying glass :)

DiaLogical
04-01-2008, 05:22 AM
I think the short answer to that is no. The limitation of PDF files is that they're meant to be displayed exactly as the layout was designed. You can zoom in, but you can't alter the font size. It's either zoom in or buy a magnifying glass :)
In that case I think I'll just go for the first option)

If anyone would know of other newspapers who publish a daily pdf version as well, I'd be glad to hear about it. Most newssites have 'mobile' versions, but so far I haven't seen any others organised on one page/in one file.

Edit: Did some more thorough searching and found a few, e.g. wikinews (http://en.wikinews.org/wiki/Wikinews:Print_edition). But no luck on the 'big ones' yet as BBC, CNN,...
Edit2: Wall street journal (http://www.feedbooks.com/news/newspaper/10). It seems feedbooks has more of these good news RSS feeds which (they) convert to pdf. Would it be possible to change the script as to download the respective pdf files from there (e.g. the Wall street journal, BBC news) as well?

cen
04-01-2008, 06:49 AM
But no luck on the 'big ones' yet as BBC, CNN,...

There is a scraped html (http://www.syngrithy.org.uk/index.php?pT=2) version of the BBC website available.


It seems feedbooks has more of these good news RSS feeds which (they) convert to pdf.


Take a look at FeedBooks iNewsStand (http://www.mobileread.com/forums/showthread.php?t=12852)

daudi
04-01-2008, 07:17 AM
That did the trick indeed, and now it sounds like a stupid mistake)
Thanks a bunch, appreciate the quick reply!

One more question, the font of the Guardian pdf files seems to be rather on the small side. Is there another quick way to enlarge them a few points instead of manually zooming with the iLiad's build in function every time?

I don't have my iliad at the moment so I have not been able to see what this looks like on the iliad, but if you have latex, pdfinfo and awk installed this script will create a latex file and process it to split the columns of the Guardian 24 World.pdf (http://download.guardian.co.uk/g24/World.pdf) and produce a long thin version of the PDF. You could then read this using continuous mode on the iliad.

Here's the code for the script. I'll attach it as well. At the moment it is a bash script that is hard-coded to work with World.pdf. With a little more work it could download the PDF, but this will do for now.

cat << EOF > temp.tex
\documentclass[a4paper]{article}
\usepackage{pdfpages}
\usepackage[lmargin=0cm,rmargin=0cm,tmargin=0cm,bmargin=0cm,no head,paperwidth=124mm]{geometry}

\begin{document}

\includepdf[pages=1, pagecommand={\thispagestyle{empty}}]{World.pdf}

EOF

## Get number of pages
NUMPAGES=$(pdfinfo World.pdf | grep Pages | awk '{ print $2 }')

for i in $(seq 2 $NUMPAGES)
do
echo \\includepdf[pages=$i, trim=0 0mm 107mm 0, clip, pagecommand={\\thispagestyle{empty}}]{World.pdf} >> temp.tex
echo \\includepdf[pages=$i, trim=107mm 0mm 0 0, clip, pagecommand={\\thispagestyle{empty}}]{World.pdf} >> temp.tex
done

cat <<EOF >> temp.tex

\end{document}

EOF

pdflatex temp.tex
mv temp.pdf World-iliad.pdf

sinman
04-01-2008, 12:11 PM
Hello, this is my first post. I've found useful rio script, so I've modified it for download 20minutos.es spanish free newspaper.

Also I've created an icon for it, close to rio Guardian ico.

Thanks to rio for this script, only it must uncomment download destination an add the Wi-Fi parameters. :thanks:

cen
04-02-2008, 04:00 AM
Hello, this is my first post. I've found useful rio script, so I've modified it for download 20minutos.es spanish free newspaper.


Great, while I don't read Spanish, I'm sure this will be of use to others.

willyloco
08-08-2008, 11:15 AM
Hi,

Looks very interesting. I want to try this out on my iLiad.
But can the content downloader for guardian24 be used at a free wifi hotspot so that I do not have to use set the ssid / enc / key??
I do not know anything about Linux so please in easy steps??