Hi OV2
When you're bored, there's a peculiar bit of behavior when the script is used on multiple channels and set to show the output in channel, where it will spew up duplicate data out of order. For example, if I'm on #chan1, and do !imdb poltergeist, and then on #chan2, !imdb daria, it will say on #chan2, Language: english, and then start showing the data for Title: 'Daria' and such.
So, it does like:
#chan1:
<rosc> .imdb is it college yet
<mybot> Is It College Yet? (2002) (TV) -
http://www.imdb.com/title/tt0285627/
<mybot> Genre : Animation / Comedy
<mybot> Director: Karen Disher
<mybot> Runtime : 90 mins.
<mybot> Country : USA / South Korea
<mybot> Language: English
<mybot> Plot : Daria, Jane, and the rest of the Lawndale High seniors face graduation and college in this series finale TV-movie from MTV's 'Daria.'
#chan2:
<rosc> .imdb daria
<mybot> Genre : Animation / Comedy
<mybot> Country : USA / South Korea
<mybot> Language: English
<mybot> 'Daria' (1997) -
http://www.imdb.com/title/tt0118298/
<mybot> Tagline : Talks Slow, Thinks Fast
<mybot> Director: Ray Kosarin
<mybot> Runtime : 22 mins.
<mybot> Plot : A smart & cynical girl goes through teenage life as an proud outsider in a world of mainly idiotic teens and condescending adults.
That's the bug I've found.
And the requests:
Could you have the script parse for multiple directors? Sometimes there is more than one. I tried to emulate how the 'Genre' tags are grabbed but not having much luck at getting it working.
Also, would like to ask if you would implement a function to get the cast.
I know that the cast list can be pretty long, perhaps allow a user-specified number of matches returned?
And maybe return the writers credits?
BTW, I just added the awards to the script, so I'll post a diff file. I know this is not optimized, would appreciate any help to make this more efficient:
Code: Select all
--- /home/geetob/work/imdb210106.tcl Sat Jan 21 20:51:56 2006
+++ ./imdb210106.tcl Thu May 11 05:08:15 2006
@@ -49,2 +49,3 @@
# RUNTIME = %time |
+# AWARDS = %awards |
# BUDGET = %budget |
@@ -330,3 +338,3 @@
set runtime "N/A" ; set budget "N/A" ; set screens "N/A" ; set country "N/A"
- set language "N/A" ; set soundmix "N/A" ; set top250 "top/bottom:N/A"
+ set language "N/A" ; set soundmix "N/A" ; set top250 "N/A"; set awards "N/A"
set rating_bar ""
@@ -421,2 +426,15 @@
if {$IMDB_DEBUG == 1} { putlog "IMDB_DEBUG runtime == $runtime" }
+ ## get awards
+ if [regexp {<b class=\"ch\">Awards:</b>.*?<a} $html awards] {
+ regsub -all {[\n]+} $awards {} awards
+ regsub -all {<a} $awards {} awards
+ regsub -all {&} $awards {, } awards
+ set pos [string last > $awards] ; incr pos
+ set awards [string range $awards $pos end]
+ set pos [string last : $awards]
+ if {$pos != -1} {incr pos ; set awards [string range $awards $pos end]}
+ set awards [string trimleft $awards]
+ }
+ if {$IMDB_DEBUG == 1} { putlog "IMDB_DEBUG awards == $awards" }
+
## get country
@@ -491,2 +505,3 @@
set output [replacevar $output "%time" $runtime]
+ set output [replacevar $output "%awards" $awards]
set output [replacevar $output "%country" $country]
Thanks much for fixing this script