Dimitris Area
linux
life_etc
unclassified_info links
downloads
course
  photo_album private_area  contact_me about_me
 

BBC News 365 days a year

This is a small script that I wrote, in order to keep a World News diary in my computer.


The idea is simple: I just use wget to download the no-graphics version of the BBC news headlines, and then I convert it to a text file (with no html code in it) by using the html2text program. I also name it by using the date as part of it's name.


Ideally, this should run as a cron job daily, so you get a good set of headlines after a few years!


By the way this script will not work unless you visit the website once, and then copy the cookie that BBC has created, into the folder where your script is. You may have noticed already the "--load-cookies=cookie.txt" option that I used in the wget format.


Also if you run this job daily, you may want to get automatically a print out as well... The option is there for you if you want to use it!



..And here is the script!...

echo "=================================================================================";

echo "Initialising...";

echo "=================================================================================";

echo "connecting to BBC...";

echo "=================================================================================";

echo "downloading today's headlines...";

wget -q -nd --load-cookies=cookies.txt --tries=50 -k http://news.bbc.co.uk/text_only.stm -O bbc-temp-`date -I`.html;

echo "=================================================================================";

echo "converting to text format, using html2text...";

html2text -nobs bbc-temp-`date -I`.html > bbc-main-headlines-`date -I`.txt;

echo "=================================================================================";

echo "removing temporary html file...";

rm -f bbc-temp-`date -I`.html;

echo "=================================================================================";

echo "ALL DONE! - File saved as bbc-main-headlines-`date -I`.txt";

echo "=================================================================================";

echo "enable this command if you need an automatic print-out:";

echo "lp bbc-main-headlines-`date -I`.txt";

echo "=================================================================================";

echo "Script written by Arkadian - Sept 02 2002";

echo "=================================================================================";

echo "the program will now exit";

echo "=================================================================================";




Copyright 2002: D Mitsinikos - if you wish to copy parts of my website, by all means do, but please include my name and my web address