#!/usr/local/bin/perl
############### MAIN ###############
# Quick and dirty routine to get Yahoo news
# Developed by Ricky J. Sethi for http://www.sethi.org
# Should save result to a text file and then SSI the sucker where you want
#
# Version 1.0
# - Current version (2.0) uses LWP::UserAgent & RobotUA; also the script
# is much more complicated (since it gets data from multiple news
# sources) and relies on a configuration file to set various
# parameters.
# - Might be remnants here of stuff used in the current version
# - magic switch needs to be fixed in regex
###
# Initialization
###
### Use the right packages
use LWP::Simple;
### Set date correctly (using my perllib):
#$longDate = GetNiceDate(long);
$longDate = `date`;
### Set url here:
$url = "http://dailynews.yahoo.com";
### Where should we save the crappola?
$logfile = "news-yahoo.html";
### Debug?
$DEBUG = 0;
###
# Let's get right to it:
###
### Get the data:
my $urldata = GetUrlData($url);
### Log the match:
open (LOGFILE, ">$logfile");
if ($DEBUG) {print "The URL is $url and the data is $urldata\n";}
print LOGFILE "
$urldata