Perhaps you should try reading the FIRST sentence of the FIRST post in this thread?dmssf wrote:anyone got a complete copy of this script thats working?
Code: Select all
[21:10] TVRage(DEBUG): Getting http://services.tvrage.com/tools/quickinfo.php?show=House
[21:10] TVRage(DEBUG): Entering show info handler.
can't read "request(::http::10,chan)": no such element in array
while executing
"set show(chan) $request($token,chan)"
(procedure "::tvrage::getShowInfoHandler" line 7)
invoked from within
"::tvrage::getShowInfoHandler $token"
("eval" body line 1)
invoked from within
"eval $state(-command) {$token}"
("eval" body line 19)
invoked from within
"eval ::error $errorlist"
(procedure "http::reset" line 11)
invoked from within
"http::reset ::http::10 timeout"
("after" script)
It's a logic flaw. A slight bug in how it anticipates errors. To correct this is simple.Rizli wrote:Also sometime !showinfo doesn't work, here some debug:
Code: Select all
[21:10] TVRage(DEBUG): Getting http://services.tvrage.com/tools/quickinfo.php?show=House [21:10] TVRage(DEBUG): Entering show info handler. can't read "request(::http::10,chan)": no such element in array while executing "set show(chan) $request($token,chan)" (procedure "::tvrage::getShowInfoHandler" line 7) invoked from within "::tvrage::getShowInfoHandler $token" ("eval" body line 1) invoked from within "eval $state(-command) {$token}" ("eval" body line 19) invoked from within "eval ::error $errorlist" (procedure "http::reset" line 11) invoked from within "http::reset ::http::10 timeout" ("after" script)
Code: Select all
debug DEBUG "Entering show info handler."
set show(chan) $request($token,chan)
set show(nick) $request($token,nick)
set displayLine $request($token,displayLine)
debug DEBUG "Checking for http errors."
if { [http::status $token] == "timeout" } {
set problem "Timeout retrieving show info."
debug ERROR "$problem"
set show(problem) $problem
displayInfo [templateParser $tvrage(problemMessage) [array get show]]
cleanupRequest $token
[http::cleanup $token]
return
} elseif { [http::status $token] != "ok" } {
set problem [http::error $token]
[http::cleanup $token]
debug ERROR "$problem"
set show(problem) $problem
displayInfo [templateParser $tvrage(problemMessage) [array get show]]
cleanupRequest $token
return
}
set data [http::data $token]
http::cleanup $token
Code: Select all
debug DEBUG "Entering show info handler."
debug DEBUG "Checking for http errors."
if {![string equal -nocase [::http::status $http] "ok"]} {
set problem [::http::error $token]
::http::cleanup $token
debug ERROR "$problem"
set show(problem) $problem
displayInfo [templateParser $tvrage(problemMessage) [array get show]]
cleanupRequest $token
return
}
set show(chan) $request($token,chan)
set show(nick) $request($token,nick)
set displayLine $request($token,displayLine)
set data [::http::data $token]
::http::cleanup $token
Code: Select all
proc getShowInfo {displayLine nick chan text} {
variable tvrage
variable request
upvar show show
set url $tvrage(showinfourl)[http::formatQuery {show} [string trimleft $text]]
debug DEBUG "Getting $url"
if {[catch {set token [http::geturl $url -command [namespace current]::getShowInfoHandler -timeout [expr $tvrage(httpTimeout) * 1000]]} error]} {
error $error
} {
set request($token,nick) $nick
set request($token,chan) $chan
set request($token,displayLine) $displayLine
}
}
Code: Select all
proc getShowInfo {displayLine nick chan text} {
variable tvrage
variable request
upvar show show
set url $tvrage(showinfourl)[http::formatQuery {show} [string trimleft $text]]
debug DEBUG "Getting $url"
catch { http::geturl $url -command [namespace current]::getShowInfoHandler -timeout [expr $tvrage(httpTimeout) * 1000] } error
if {[string match -nocase "::http::*" $error]} {
set request($error,nick) $nick
set request($error,chan) $chan
set request($error,displayLine) $displayLine
} { error $error }
}
Okay and what about all the other questions/suggestions I've had? (quoted it)Rizli wrote:Hello,
so I am trying to run your script on a machine that is in the CET timezone..
Can someone please explain me how to configure your script properly to announce US tv shows on time?
The offset and fudgeMinutes settings get me somehow confused!!
Airtime 08:00 pm = 02:00 am at my place, so that'd be +7 hours
ps. it would be nice if the script could handle all the timezone stuff better, like !today and show the times in original and user timezone
08:00 pm (02:00 am CET) - CBS - How I Met Your Mother 07x05 <> The CW - Gossip Girl 05x03 <> FOX - Terra Nova 01x04 <> ABC Family - The Lying Game 01x09
Also because here it's already next day, when someone triggers !today at 2 am (which equals to 08:00 pm) it shows the next days shows and not the shows that will actually air duo to the timezone issues...
I had to edit the code, as offsetHours was only moving the announce to a earlier time (minus) while I needed it the other way around..GaveUp wrote:Play with the offsetHours and fudgeMinutes settings. Using those it will announce correctly. You are capable of displaying the announcement how you described by adding a bit of tcl to the theme setting to get the current date offset by the minutesBefore setting.