I am running an IRC bot to capture CNN news
When I call any news, it gave me the following
!news list
CNN Top Stories Headlines (c) CNN.com - by Thrill "!news help"
for options
Get RSS direct from CNN.com! (http://www.cnn.com/services/rss/index.html)
I am using the following news.tcl
# CNN news.tcl V1.1
# by Thrill
#
# All newsheadlines parsed by this script are (C) cnn.com
#
# Version History: V1.0 - first public release
# V1.01 - stupid bug ('putchan') fixed
# V1.1 - added URL's to the newsitem.
# Remember to change this script before implementing it!
Remove/comment the 'die "CNN News not changed!"' afterwards.
# Only the location of lynx needs change.
#
# The author takes no responsibility whatsoever for the usage and
working of this script !
#
# E-mail: [EMAIL PROTECTED]
# default bind command !news, change to your liking
bind pub - "!news" news
# set the location of lynx here. Normally this should be ok.
#set lynx "/usr/bin/lynx"
set lynx "/usr/local/bin/lynx"
#set locations of tempfiles here, default /tmp/newstmp1.txt,
newstmp2.txt should be ok
set ftemp1 "/tmp/newstmp1.txt"
set ftemp2 "/tmp/newstmp2.txt"
# comment or remove this when you are done
# die "CNN News not changed!"
# see function PARSE below for the output-string, which can be changed
if you like, example included.
DO NOT EDIT BELOW - EVERY CHANGE IS ON YOUR OWN RISK AND COULD
LEAD THIS SCRIPT TO FAIL!
#define all strings here
set topstories"TOP STORIES"
set world "WORLD"
set us"US"
set politics "POLITICS"
set weather "WEATHER"
set business "BUSINESS from CNNfn.com"
set sports"SPORTS from CNNSI.com"
set technology"TECHNOLOGY"
set space "SPACE"
set health"HEALTH"
set entertainment "ENTERTAINMENT"
set travel"TRAVEL"
# Function: news
# Purpose : public function called by the bind !news, selects
user-choice and forwards to 'parse'-function
proc news { nick uhost handle chan arg } {
global topstories world us politics weather business sports
technology space health entertainment travel
if {[llength $arg]==0} {
putserv "PRIVMSG $chan :Please enter which news you would like
to read (!news help)"
} else {
if { [lindex $arg 0] == "help" } {
putserv "notice $nick :CNN News v1.1 - www.cnn.com - by Thrill"
putserv "notice $nick :Usage: !news "
putserv "notice $nick :where is one of the following:"
putserv "notice $nick :^Btop^B - Top Stories,
^Bworld^B - World News"
putserv "notice $nick :^Bus^B - US News,
^Bpolitics^B - Politics News"
putserv "notice $nick :^Bweather^B - Weather News ,
^Bbusiness^B - Business News"
putserv "notice $nick :^Btech^B- Technology News,
^Bspace^B - Space News"
putserv "notice $nick :^Bhealth^B - Health News,
^Bentertain^B - Entertainment News"
putserv "notice $nick :^Bsports^B - Sports News,
^Btravel^B- Travel News"
} else {
# first get the news into the two tempfiles, seperated on
headlines and references
getnews $nick $chan
# now parse the selected news to the chan
switch [lindex $arg 0] {
"top" {
putchan $chan "^C3CNN Top Stories Headlines (c) CNN.com -
by Thrill^C"
parse $nick $uhost $handle $chan $topstories
}
"world" {
putchan $chan "^C3CNN World News Headlines (c) CNN.com -
by Thrill^C"
parse $nick $uhost $handle $chan $world
}
"us" {
putchan $chan "^C3CNN US Headlines (c) CNN.com - by Thrill^C"
parse $nick $uhost $handle $chan $us
}
"politics" {
putchan $chan "^C3CNN Politics Headlines (c) CNN.com - by Thrill^C"
parse $nick $uhost $handle $chan $politics
}
"weather" {
putchan $chan "^C3CNN Weather Headlines (c) CNN.com - by Thrill^C"
parse $nick $uhost $handle $chan $weather
}
"business" {
putchan $chan "^C3CNN Business Headlines (c) CNN.com - by Thrill^C"
parse $nick $uhost $handle $chan $business
}
"tech" {
putchan $chan "^C3CNN Technology Headlines (c) CNN.com -
by Thrill^C"
parse $nick $uhost $handle $chan $technology
}
"space" {
putchan $chan "^C3CNN Space Headlines (c) CNN.com - by Thrill^C"
parse $nick $uhost $handle $chan $space
}
"health" {
putchan $chan "^C3CNN Health Headlines (c) CNN.com - by Thrill^C"
parse $nick $uhost $handle $chan $health
}
"entertain" {
putchan $chan "^C3CNN Entertainment Headlines (c) CNN.com
- by Thrill^C"
parse $nick $uhost $handle $chan $entertainment
}
"sports" {
putchan $chan "^C3CNN Sports Headlines (c) CNN.com - by T