simple shell script to download the frontpage of major greek newspapers has a very usefull feature on their site, it has all major greek newspapers’ front page scanned and posted in a place called kiosk.

Even though this is very nice, it doesn’t fit my viewing needs, I want all newspapers on my local drive every morning so I can view them with my favorite image viewer. In order to do so I created a small shell script.

The script:

#simple shell script to download the frontpage of major greek newspapers from
#feel free to modify it as you wish :)
YEAR=`date +%Y`
MONTH=`date +%m`
DAY=`date +%d`
mkdir -p ~/${YEAR}/${MONTH}/${DAY}/
cd ~/${YEAR}/${MONTH}/${DAY}/
exclude=(30 31 32 33 34 58 60 61 69 78 79)
while [ "$i" -lt 80 ]; do
if [ "$i" = "${exclude[$j]}" ]; then
echo "excluding $i"
wget -q -nc -c${YEAR}/${MONTH}/${DAY}/${i}_h.jpg
while [ "$k" -lt $include_len ]; do
wget -q -nc${YEAR}/${MONTH}/${DAY}/${include[$k]}_h.jpg

Just add the script to your user’s crontab and you are ready. Since not all newspapers come out in the morning at the same time, you can add that script to run on your crontab every one hour in the morning from 7 o’clock until 12 o’clock.

Some details:
The kiosk has an interesting and weird “feature”. To find a newspaper’s ID-url you can go to and click on the newspaper you want. A window with a thumbnail will appear, click on the thumbnail and a new pop-up window with a bigger image will come forward. Now right click on the image and select copy image location. It should be something like: Even though most newspapers feature sequential numbering until number 34, some come with a higher number like 53, 60, 61, 78, 79. So while one might think that it’s safe to iterate until 80 to catch them all, that’s not the case. Some sports and all local newspapers have ID numbers like 69389! In order to cope with these, for anyone who might want them, I added another loop in the script that uses an “include” array. Put any high numbers above 80 inside the include array (seperated by a whitespace) and the script will download them. Since I don’t like reading sports and gossip newspapers I have added an exclude array in the main loop in order to avoid downloading them. If you want to download all newspapers simply remove the numbers I have in my exclude list.

I don’t understand what’s the purpose of having both small sequential numbers and bigger “random” ones as IDs. Do you ?