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.

Tv.com tv show info grabber?

Support & discussion of released scripts, and announcements of new releases.
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

It's probably my fault, the setudef was missing in the code above.
k
koom
Voice
Posts: 22
Joined: Sat Jul 30, 2005 9:23 pm

Post by koom »

i know it's asking alot, but any chance of having "Next episode airs in: blah days" added in?
I looked on tv.com and found out that it says when a specific ep airs, but it would be cool to show how many days until it airs (and not the date of it :))

Thanks,
koom
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

There's other scripts doing that already. Like EPGuru, parsing from epguides.
k
koom
Voice
Posts: 22
Joined: Sat Jul 30, 2005 9:23 pm

Post by koom »

I shall have a look, thanks
w
w0lfstar
Voice
Posts: 22
Joined: Fri May 20, 2005 9:26 am

Post by w0lfstar »

they are all outdated..
W
Wiz4rd
Voice
Posts: 1
Joined: Thu Sep 08, 2005 11:16 pm

Post by Wiz4rd »

No matter what I do I can't get this script to work. Its all loaded up fully. No errors, When I do !tvinfo joey it does nothin in channel and in dcc chat i see this <<Wiz4rd>> !Wiz4rd! !tvinfo joey

And thats all it does. What gives?
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

.chanset #channel +tv
c
cBuster
Voice
Posts: 5
Joined: Thu Sep 22, 2005 7:06 am

Post by cBuster »

greenbear: Would be really happy if you would like to do a script like that one "w0lfstar" talked about.
w0lfstar wrote: example:

Joe: !tv 24
Bot: Tv Info for: 24 (Action/Adventure , Drama)
Bot: Latest: S04E24 - Day 4: 6:00 A.M.-7:00 A.M. on 5/23/2005
Bot: Next: Unknown.

Joe: !tv desperate housewives
Bot: Tv Info for: Desperate Housewives (Drama , Comedy)
Bot: Latest: S01E23 - One Wonderful Day on 5/22/2005
Bot: Next: S02E01 - Season 2 Premiere (TBA) on 9/25/2005
F
Figga
Voice
Posts: 6
Joined: Tue Aug 30, 2005 10:25 am

The information is not on the site to parse ..

Post by Figga »

The information u request is not on the site to parse as yet , it would be better to find a different site to parse the info that you require , if you can find a good one that doesnt change its layout to often i would be happy to code this for you ....
c
cBuster
Voice
Posts: 5
Joined: Thu Sep 22, 2005 7:06 am

Re: The information is not on the site to parse ..

Post by cBuster »

Figga wrote:The information u request is not on the site to parse as yet , it would be better to find a different site to parse the info that you require , if you can find a good one that doesnt change its layout to often i would be happy to code this for you ....
You can always use http://epguides.com/PrisonBreak/. (ex)
J
JAFO
Voice
Posts: 19
Joined: Thu Oct 13, 2005 1:18 pm

Post by JAFO »

A friend of mine did a lil work on the script

Code: Select all

###
# Parse show info from tv.com

# Enable with .chanset #channel +tvi

# [0/1] public or private reply's (public 0, private 1)
set tvreply 0

# offset to EST
# 6 hours makes sense for CET (Europe)
set tvoffset 6

if ![info exists egghttp(version)] {
  putlog "egghttp.tcl was NOT successfully loaded."
}

setudef flag tvi

bind pub - !tvinfo pub:info.tv.com

proc pub:info.tv.com {nick uhost hand chan text} {
  if ![channel get $chan tvi] return
  if {$::tvreply} {set target $nick} {set target $chan}
  if {$text==""} {putserv "PRIVMSG $target :Usage: $::lastbind <show>"; return}
  set search [join [lrange [split $text] 0 e] {+}]
  set d [date:offset [clock seconds] %m%d%y]
  set url "http://www.tv.com/search.php?type=11&stype=program&qs=$search&search=Search/"
  set sock [egghttp:geturl $url [list findrealurl:tv.com $target] -headers "Cookie: tv_promo_$d=1"]
}

proc findrealurl:tv.com {target sock} {
 set data [egghttp:data $sock]
 egghttp:cleanup $sock

 foreach line [split $data \n] {
  if [string match -noc "*returned no results*" $line] {
    putserv "PRIVMSG $target :Unknown show."
    return
  }
  if [string match -noc *www.tv.com*show*summary.html* $line] {
    regexp -nocase {(http://)[^\"]+} $line url
    set d [date:offset [clock seconds] %m%d%y]
    set s [egghttp:geturl $url [list parseinfo:tv.com $target $url] -headers "Cookie: tv_promo_$d=1"]
    return
  }
 }
}

proc parseinfo:tv.com {target url sock} {
 set data [egghttp:data $sock]
 egghttp:cleanup $sock

 set data [string map {"\n" "" "</div>" "</div>\n" "<br />" "<br />\n"} $data]
 set dV 0
 foreach line [split $data \n] {
   if [regexp {<title>(.*).TV Show} $line . show] {
     putserv "PRIVMSG $target :Show: $show"
   }
   if [string match -nocase "*Airs:*" $line] {
     regsub -all {<(.|\n)*?>} $line {} airs
     putserv "PRIVMSG $target :[concat [join $airs]]"
   }
   if [string match -nocase "*Status:*" $line] {
     regsub -all {<(.|\n)*?>} $line {} status
     putserv "PRIVMSG $target :[concat [join $status]]"
   }
   if [string match -nocase "*Premiered*" $line] {
     regsub -all {<(.|\n)*?>} $line {} premiered
     putserv "PRIVMSG $target :[concat [join $premiered]]"
   }
   if [string match -nocase "*Show Category:*" $line] {
     regsub -all {<(.|\n)*?>} $line {} category
     putserv "PRIVMSG $target :[concat [join $category]]"
   }
   if [string match -nocase "*, 200*" $line] {
     regsub -all {<(.|\n)*?>} $line {} Dates
     if ![string match -nocase "*Premiered*" $line] {
       if {$dV == 0} {
         putserv "PRIVMSG $target :Next Air Date: [concat [join $Dates]]"
       } else {
         putserv "PRIVMSG $target :Last Air Date: [concat [join $Dates]]"
       }
       incr dV
     }
   }
 }
 putserv "PRIVMSG $target :URL: $url"
}

proc date:offset {epox arg} {
 set t [expr $epox-((60*60)*$::tvoffset)]
 set w [clock format $t -format $arg]
 return $w
}

.chanset changed also from +tv >>> +tvi ( coz i allready used +tv in tv.com.tcl v0.2 by greenbear )

Might contain unlogical data , but it works :)

Code: Select all

<~me> !tvinfo 24
<@MyBot> Show: 24
<@MyBot> Airs: Monday 9:00 PM on FOX (60 mins)
<@MyBot> Status: Returning Series
<@MyBot> Premiered November 6, 2001
<@MyBot> Show Category: Action/Adventure , Drama
<@MyBot> Next Air Date: Sunday January 15, 2006
<@MyBot> Last Air Date: Monday May 23, 2005
<@MyBot> URL: http://www.tv.com/24/show/3866/summary.html?q=24
Njoy :D
I
InsideTheBox
Voice
Posts: 1
Joined: Mon Oct 17, 2005 5:56 pm

Post by InsideTheBox »

<luciverse> !tvinfo The Ultimate Fighter

Tcl error [pub.tvinfo.com]: unknown channel command: should be one of: add, set, info, remove

:cry:
T
Taz
Voice
Posts: 9
Joined: Sun Oct 23, 2005 10:18 pm

Thanx

Post by Taz »

Thanx to you and your friend JAFO. This is exactly what a lot of us wanted.
p
pEeDy
Voice
Posts: 2
Joined: Tue Nov 01, 2005 7:51 pm

Post by pEeDy »

Where do I type this '.chanset #channel +tvi' ?? I tried in a query, a private message and in channel... DCC chat doesn't work... help me please? :(

Edit; got it :D
For other noobs:
You have to put it in your telnet window :)
And you have to load egghttp.tcl too, before you load this tcl script.
o
outthere
Voice
Posts: 33
Joined: Sat Nov 26, 2005 7:25 pm

error

Post by outthere »

wow.. i have been looking for something like this... thx

i am getting an error though when i do !tvinfo ep

Tcl error [pub:info.tv.com]: invalid command name "Â "

i checked egghttp and tvi tcl and cant find that text anywhere..
i think it might be a simple problem a noob like me doesnt know anything about.. any help would be greatly appreciated...

thx :?
Post Reply