| View previous topic :: View next topic |
| Author |
Message |
koom Voice
Joined: 30 Jul 2005 Posts: 22
|
Posted: Fri Aug 05, 2005 9:07 am Post subject: Tv.com tv show info grabber? |
|
|
Hey all,
I'm looking for a script to use in my channel to find out the info of a tv show. for example :
When i trigger the trigger, !TVinfo 24 in this case (24 obviously being the tv show)
http://www.tv.com/24/show/3866/summary.html
Genre: : Action/Adventure , Drama
Tagline: Counter-Terrorism agent Jack Bauer (Kiefer Sutherland) fights the bad guys of the world, one day at a time.
Runtime: 60 minutes
Rating: 9.0 Superb
I would look into doing this myself, but i am a complete noob at tcl scripting..
Hopefully someone can help me out
Thanks alot,
Koom |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Fri Aug 05, 2005 9:56 pm Post subject: |
|
|
that someone could only be greenbear check out his tv.com script in the other forum and hope he'll be bored enough, having nothing better to do, to implement what you want |
|
| Back to top |
|
 |
koom Voice
Joined: 30 Jul 2005 Posts: 22
|
Posted: Sat Aug 06, 2005 7:06 am Post subject: |
|
|
thanks demond, will ask him now  |
|
| Back to top |
|
 |
theauth0r Voice
Joined: 04 Aug 2005 Posts: 6
|
Posted: Sat Aug 06, 2005 7:13 pm Post subject: |
|
|
any update on this topic..
I wouldnt mind having this script if possible
thx |
|
| Back to top |
|
 |
koom Voice
Joined: 30 Jul 2005 Posts: 22
|
Posted: Sun Aug 07, 2005 4:25 am Post subject: |
|
|
| i completely forgot to ask him! will do now |
|
| Back to top |
|
 |
greenbear Owner
Joined: 24 Sep 2001 Posts: 733 Location: Norway
|
Posted: Sun Aug 07, 2005 11:05 am Post subject: |
|
|
Sure, I wouldnt mind doing this.. The only problem is I dont see any of that info you asked for on that tv.com page.
A page search returns nothing on both genre, tagline and runtime. |
|
| Back to top |
|
 |
w0lfstar Voice
Joined: 20 May 2005 Posts: 22
|
Posted: Sun Aug 07, 2005 1:30 pm Post subject: |
|
|
i think a script that tells latest and next episode is what people would like more, since all the scripts that are available are outdated because of tv.com changes.
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
etc..what do you think? I'm not sure if epguides.com is more easy, but such a script might be wanted by many
greets wolfy. |
|
| Back to top |
|
 |
greenbear Owner
Joined: 24 Sep 2001 Posts: 733 Location: Norway
|
Posted: Sun Aug 07, 2005 2:48 pm Post subject: |
|
|
ok, I think this is somewhat what koom had in mind...
| Code: | ###
# Parse show info from tv.com
# Enable with .chanset #channel +tv
# [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 tv
bind pub - !tvinfo pub:info.tv.com
proc pub:info.tv.com {nick uhost hand chan text} {
if ![channel get $chan tv] 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]
foreach line [split $data \n] {
if [regexp {<title>(.*).TV Show} $line . show] {
putserv "PRIVMSG $target :Show: $show"
}
if [string match -noc "*Airs:*" $line] {
regsub -all {<(.|\n)*?>} $line {} airs
putserv "PRIVMSG $target :[concat [join $airs]]"
}
if [string match -noc "*Status:*" $line] {
regsub -all {<(.|\n)*?>} $line {} status
putserv "PRIVMSG $target :[concat [join $status]]"
}
if [string match -noc "*Premiered*" $line] {
regsub -all {<(.|\n)*?>} $line {} premiered
putserv "PRIVMSG $target :[concat [join $premiered]]"
}
if [string match -noc "*Show Category:*" $line] {
regsub -all {<(.|\n)*?>} $line {} category
putserv "PRIVMSG $target :[concat [join $category]]"
}
if [string match -noc "*Full Summary*" $line] {
regsub -all {<(.|\n)*?>} $line {} summary
regexp {(.*) Full Summary} $summary . summary
putserv "PRIVMSG $target :Summary: [concat [join $summary]]"
}
}
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
}
|
EDIT: Added option for public/private replies.
Last edited by greenbear on Sat Aug 13, 2005 12:19 am; edited 3 times in total |
|
| Back to top |
|
 |
koom Voice
Joined: 30 Jul 2005 Posts: 22
|
Posted: Mon Aug 08, 2005 4:55 am Post subject: |
|
|
thanks for your help greenbear, really appreciated
i just installed the script, but when i went to enable it by:
.chanset #koom +tv
this didnt work. errored with
chanset #koom +tv
::18:20:: -BTC|Bot- Error trying to set +tv for #koom, invalid mode. |
|
| Back to top |
|
 |
greenbear Owner
Joined: 24 Sep 2001 Posts: 733 Location: Norway
|
Posted: Mon Aug 08, 2005 5:01 am Post subject: |
|
|
| oops, seems like I forgot to define it.. it's fixed now |
|
| Back to top |
|
 |
koom Voice
Joined: 30 Jul 2005 Posts: 22
|
Posted: Mon Aug 08, 2005 5:07 am Post subject: |
|
|
wow thanks for the fast reply
seems the other error is gone now, but another one has appeared (as what happens always with tcl scripting, hehe)
::18:36:: -BTC|Bot- [03:07] Tcl error [pub:info.tv.com]: invalid command name "egghttp:geturl"
Thanks alot,
koom |
|
| Back to top |
|
 |
greenbear Owner
Joined: 24 Sep 2001 Posts: 733 Location: Norway
|
Posted: Mon Aug 08, 2005 5:15 am Post subject: |
|
|
| load egghttp.tcl before this one |
|
| Back to top |
|
 |
koom Voice
Joined: 30 Jul 2005 Posts: 22
|
Posted: Mon Aug 08, 2005 5:45 am Post subject: |
|
|
sorry, but where can i find this egghttp.tcl? (like i said before, noob at this kinda stuff, ) |
|
| Back to top |
|
 |
koom Voice
Joined: 30 Jul 2005 Posts: 22
|
Posted: Mon Aug 08, 2005 5:49 am Post subject: |
|
|
ah dont worry about it, a quick search found it,now to test it  |
|
| Back to top |
|
 |
koom Voice
Joined: 30 Jul 2005 Posts: 22
|
Posted: Mon Aug 08, 2005 5:58 am Post subject: |
|
|
Yay, script works great, thanks alot greenbear
Also, anyway to make it so that script notices people instead of spamming the channel?
Other then that, it works like a charm
also, is it possible for it to display the link last?
Thanks
Koom |
|
| Back to top |
|
 |
|