This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

TVRage.com Schedule Script (Latest: 2.0)

Support & discussion of released scripts, and announcements of new releases.
Post Reply
d
dmssf
Voice
Posts: 5
Joined: Sun Aug 13, 2006 6:21 pm

anyone got a complete copy of this script thats working?

Post by dmssf »

anyone got a complete copy of this script thats working?
G
GaveUp
Op
Posts: 139
Joined: Thu Jan 19, 2006 3:56 am

Re: anyone got a complete copy of this script thats working?

Post by GaveUp »

dmssf wrote:anyone got a complete copy of this script thats working?
Perhaps you should try reading the FIRST sentence of the FIRST post in this thread?
M
McGuyver
Voice
Posts: 14
Joined: Wed Aug 31, 2011 1:27 pm

Post by McGuyver »

Is there anyway to filter by showname instead of network?
G
GaveUp
Op
Posts: 139
Joined: Thu Jan 19, 2006 3:56 am

Post by GaveUp »

McGuyver wrote:Is there anyway to filter by showname instead of network?
No there isn't right now.
d
dmssf
Voice
Posts: 5
Joined: Sun Aug 13, 2006 6:21 pm

getting partyline error

Post by dmssf »

<@user> !showinfo Majors & Minors
<@eggdrop> Title :: Majors & Minors <> URL :: http://www.tvrage.com/shows/id-29411 <> Premiered :: 2011 <> Latest Episode :: 01x01 - One World - Part 1 (Sep/23/2011) <> Next Episode :: 01x02 - One World - Part 2 (Sep/30/2011) <> Country :: USA <> Status :: New Series <> Airtime :: Friday at 08:00 pm

but everytime i do showinfo in channel on the partyline i get
{e%airtime: 08<>15 03Airtime ::15 04{%%airtime%%}15%e} :::: airtime :::: :::: :::: 08<>15 03Airtime ::15 04{%%airtime%%}

anyone else getting this or know how to fix?
G
GaveUp
Op
Posts: 139
Joined: Thu Jan 19, 2006 3:56 am

Post by GaveUp »

The party line spam was due to debug code that I forgot to remove. It has been removed from the latest version.
R
Rizli
Voice
Posts: 5
Joined: Mon Oct 10, 2011 7:38 am

Post by Rizli »

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...
R
Rizli
Voice
Posts: 5
Joined: Mon Oct 10, 2011 7:38 am

Post by Rizli »

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)
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

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)
It's a logic flaw. A slight bug in how it anticipates errors. To correct this is simple.

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
Change that code block above, to look like it does below...

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
This should solve your problem, and correctly report "timeout" when it's a timeout instead of generating tcl errors. How do I know it's a timeout that is causing the issue...
It's right there at the end of your errorInfo reponse: "http::reset ::http::10 timeout"
But.. its caught... and the script attempts to attain variables first, instead of checking for http errors. This was the problem, I've corrected that problem.

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
	}
}
I would also change the procedure above, to more accurately handle these types of exceptions. I would make it exactly as you see it below...

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 }
}
This adds a pretty clear check that the variable has a proper http token before it sets its variables.
G
GaveUp
Op
Posts: 139
Joined: Thu Jan 19, 2006 3:56 am

Post by GaveUp »

A couple of issues with it, though. One is, I assume, $http should be $token on the if. The other is that the displayInfo line will always fail in this scenario since show(chan) and show(nick) are set afterwards.

That was/is one of the problems I'm trying to find a proper solution for. Occasionally the handler is called before the request variables are set which causes the the error, but if I don't have those two variables (or one depending on the specific theme) I can't display to the user that there was a problem.

If you've got a solution I'm open to it. The way the code is now is based on another post on the forum (maybe by you?) that handled passing variables to the handler the same way, but there was no mention of this particular scenario or how to handler it and as I said before I haven't come up with one.
R
Rizli
Voice
Posts: 5
Joined: Mon Oct 10, 2011 7:38 am

Post by Rizli »

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...
Okay and what about all the other questions/suggestions I've had? (quoted it)

I still can't figure out how to configure it to work properly with my timezone (CET). No matter what I set it just doesn't announce on time...
G
GaveUp
Op
Posts: 139
Joined: Thu Jan 19, 2006 3:56 am

Post by GaveUp »

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.
R
Rizli
Voice
Posts: 5
Joined: Mon Oct 10, 2011 7:38 am

Post by Rizli »

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.
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..
G
GaveUp
Op
Posts: 139
Joined: Thu Jan 19, 2006 3:56 am

Post by GaveUp »

Never heard of a negative number, huh?
R
Rizli
Voice
Posts: 5
Joined: Mon Oct 10, 2011 7:38 am

Post by Rizli »

GaveUp wrote:Never heard of a negative number, huh?
Just assumed it wouldn't work, oh well whatever.
Post Reply