News Headlines


These are the headlines from the BBC World News of today. If you click on the title, you will automatically surf to the page at BBC to get the full news story.

BBC World News:

#!/usr/bin/perl # File: bbcnews.cgi # Description: This script displays current BBC News Headlines and a brief summary # for inclusion in a Web page using SSI. # Author: Martin Webster # Email: mwebster@cebidae.co.uk # Web: http://www.cebidae.co.uk/ # Version: 1.0 # # (c) 2000 Martin Webster # # To install this script simply upload it to your CGI-BIN and CHMOD it 755. # # On any page where you want the BBC News Headlines displayed use this SSI call: # # Error processing SSI file
# # If you have any further questions, direct them to me at http://www.cebidae.co.uk/feedback.shtml # # This script is provided free-of-charge for non-commercial use "AS IS". If you use the # script you do so at your own risk. The author accepts no responsibility whatsoever. print "Content-type: text/html\n\n"; use LWP::Simple; $doc = get "http://news.bbc.co.uk/"; # Read the BBC News Front Page @bbc = split(/\n/, $doc); $flag = 0; $next = 0; foreach $line (@bbc) { # Look for the headlines (usually five) if ($line =~ /

/) { if ($flag eq 0) { $flag = 1; } } elsif ($line =~ /$news BBC News Front Page by Martin Webster ~; exit; sub format { # This cleans the lines so that the HTML is displayed correctly (i.e. HTML 4.01) $story =~ s/
//i; $story =~ s/<.a>//i; $story =~ s/<.b>//i; $story =~ s/]*>//i; $story =~ s/<.div>//i; $story =~ s/\t//g; $story =~ s/\r//g; $title = "@@@".$story; $title =~ s/\.//; $title =~ s/@@@ //; $title =~ s/@@@//; $title =~ s/"/''/g; $buffer =~ s/]//i; $buffer =~ s/"//i; $buffer =~ s/]*>//i; $buffer =~ s/<.b>
//i; $link = $buffer."@@@"; $link =~ s/>[^@@@]*@@@//i; $buffer =~ s/>/ target="_blank" title="$title">/i; $buffer =~ s/\t//g; $buffer =~ s/\r//g; $story = "
$story More...
"; $buffer = "
\n"; }