heyas out there.. i have a problem with my news script, i get the error msg: Invalid URI in request
i just have no idea how to fix it. plz help
thx in advance!
#cfg#
set inftrigger ".inf"
set infchans ""
set inflimit "5"
set infnewspostlimit "3"
set infnewspost "1"
set isinfhub "0"
set infleafs ""
#code#
bind msg - $inftrigger msg_inf
bind pub - $inftrigger pub_inf
bind time - "?0 * * * *" infcheck
proc sendinfnews { arg } {
global infleafs
foreach bot [bots] {
if {([lsearch -exact [string tolower $infleafs] [string tolower $bot]] != -1)} {
putbot $bot "inf: $arg"
}}}
proc shrink { calc number string start bl} { return [expr [string first "$string" $bl $start] $calc $number] }
proc html { text } {
regsub -all "ü" $text "ü" text
regsub -all "ö" $text "ö" text
regsub -all "ä" $text "ä" text
regsub -all "Ü" $text "Ü" text
regsub -all "Ö" $text "Ö" text
regsub -all "Ä" $text "Ä" text
regsub -all "ß" $text "ß" text
regsub -all """ $text "\"" text
regsub -all "<" $text "<" text
regsub -all ">" $text ">" text
return $text
}
proc infcheck {nick uhost hand chan arg} {
global infchans infnewspost isinfhub infnewspostlimit
set counter 0
if {$infnewspost == 1 } {
putlog "inf: suche nach neuer newsline"
set inflastnews "none"
if {[file exists inf.hdl]} {
set temp [open "inf.hdl" r]
set inflastnews "[gets $temp]"
if {$inflastnews == ""} { set inflastnews "none" }
close $temp
}
set temp [open "inf.hdl" w+]
if {[catch {set sock [socket
www.infernum.com 80] } sockerror]} {
putlog "error: $sockerror"
return 0 } else {
puts $sock "GET misc/newsyoyo HTTP/1.1"
puts $sock "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
puts $sock "Host:
www.infernum.com"
puts $sock "Connection: close"
puts $sock ""
flush $sock
set counter 0
while {[eof $sock] != 1} {
set bl [gets $sock]
if {[string first "misc/" $bl] != -1} {
set newsline $bl
puts $temp "[html $bl]"
}}}
close $sock ; close $temp
if {$inflastnews == "none" } { putlog "inf: headlinefile created" ; return 0 }
set temp [open "inf.hdl" r]
while { [eof $temp] != 1 } {
set infneunews [gets $temp]
if {($inflastnews == $infneunews) || ($counter == $infnewspostlimit)} { close $temp;return 0 }
incr counter
foreach chan [channels] {
if {$infchans == "" } { putserv "privmsg $chan :(neue infernum newsline) $infneunews" }
if {$infchans != "" } {
if {([lsearch -exact [string tolower $infchans] [string tolower $chan]] != -1) || ($infchans == "")} {putserv "privmsg $chan :(neue inf newsline) $infneunews"}
}
if { $isinfhub == "1" } { sendinfnews $infneunews }
}}}}
proc infnews {target limit} {
if {[catch {set sock [socket
www.infernum.com 80] } sockerror]} {
putlog "error: $sockerror"
return 0 } else {
puts $sock "GET misc/newsyoyo HTTP/1.1"
puts $sock "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
puts $sock "Host:
www.infernum.com"
puts $sock "Connection: Close"
puts $sock ""
flush $sock
set counter 0
while {[eof $sock] != 1} {
set bl [gets $sock]
if {[string first "misc/" $bl] != -1} {
putserv "privmsg $target :[incr counter] [html $bl]"
}
if {$counter == $limit} {close $sock ; return 0 }
}}}
proc msg_inf { nick uhost hand arg } { global inflimit ; infnews $nick $inflimit }
proc pub_inf { nick uhost hand chan arg } { global infchans inflimit ; if {([lsearch -exact [string tolower $infchans] [string tolower $chan]] != -1) || ($infchans == "")} { infnews $nick $inflimit }}
_____________________________________________________________