Small script (which installs itself as a daily cron if run with sudo) to download the latest front page of, in this example, the Evening Echo to the desktop as a nice little thumbnail pdf:
delivernewspaper
url="http://www.eveningecho.ie/pdf/front.pdf"
paper="eveningecho"
#!/bin/bash
home="/home/ian"
if [ ! -e /etc/cron.daily/delivernewspaper ]; then ln -s $(pwd)/delivernewspaper /etc/cron.daily/delivernewspaper; fi
cd $home/Desktop
wget $url -O ~/Desktop/$paper.pdf
delivernewspaper (2)
To download more than one, use a file in the home directory called ".newspapers" and this second edition of the script.
#!/bin/bash
config="/home/ian/.newspapers"
home="/home/ian/Desktop/newspapers"
if [ ! -e /etc/cron.daily/delivernewspaper ]; then ln -s $(pwd)/delivernewspaper /etc/cron.daily/delivernewspaper; fi
mkdir $home
chmod a+w $home
cd $home
wget -mnd -i $config
chmod a+w *
.newspapers (for example)
http://www.eveningecho.ie/pdf/front.pdf
http://download.guardian.co.uk/g24/Topstories.pdf
http://download.guardian.co.uk/g24/World.pdf
http://download.guardian.co.uk/g24/Media.pdf
http://download.guardian.co.uk/g24/Business.pdf
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment