http://qs321.pair.com?node_id=245224

In light of current world events, I think it's particularly important to keep up to date with the latest news. One of my favourite sources of news is the excellent BBC News web site. A few months ago, I noticed that they offered a desktop news ticker application. I didn't particularly like the program, but I thought it would be interesting to access its data stream, as the headlines were short and concise, and a wide range of information was available (world news, UK news, sports, weather, business, sci-tech and so on). My initial strategy was to use strings on the ticker executable, but unfortunately that didn't get me any good results. But then I had a flash of inspiration: enter HTTP::Proxy by PerlMonks' own BooK. With just one line of code I was able to set up an HTTP proxy server on my system. I set my proxy in the ticker application to localhost, and bingo, the URL of the ticker data was revealed: http://tickers.bbc.co.uk/tickerdata/story2.dat.

I downloaded this file and was presently surprised by its simple, text based format. No XML, nothing like that. Check out the file yourself to see its simple format. So, I set about creating a Perl script to parse it. It was a bit more difficult than I had expected, but I got it done.

After getting the parsing working, my main aim was to create a program that could download the file, parse it, extract the main world news headlines and send them to my mobile phone as a text message using SMS. This program would then be run via cron. It worked great - and now I can get the latest news when out and about, even when I'm in the cinema. Some might ask why I didn't use WAP, but well, my phone (Nokia 3210) doesn't support it, and I'm not ready to upgrade. Part of the reason for posting this CUFP is that you get the code and can use it for whatever you want (SMS alerts, WAP, Palm, whatever).

So, if this interests you, feel free to check out the parsing code (along with a simple example).

Another reason why I'm posting this "cool use for Perl" is that I want to get some feedback on whether or not it's worth putting this on CPAN as a module. Any comments would be appreciated.