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.

imdb-1.1.0.tcl help please

Support & discussion of released scripts, and announcements of new releases.
Post Reply
O
OV2
Voice
Posts: 35
Joined: Sat Jan 21, 2006 3:54 pm
Contact:

Post by OV2 »

anotheregglover wrote: Can anyone suggest how to get the script to output a single line 'nothing found' type error rather than all the regular multiline info categories with N/A.
[snip]

Thanks.
That was a problem with imdb's search page, i fixed it today so simply redownload.

@Luniz2k1:
I don't see anything wrong in the debug you posted - is your help-queue working?
Last edited by OV2 on Sat Jan 21, 2006 6:37 pm, edited 1 time in total.
L
Luniz2k1
Voice
Posts: 19
Joined: Wed Sep 17, 2003 12:32 am

Post by Luniz2k1 »

OV2 wrote: @Luniz2k1:
I don't see anything wrong in the debug you posted - is your help-queue working?
It used to. If !imdb is done alone:

Code: Select all

[15:55] IMDB_DEBUG permission_result == 1
[15:55] IMDB_DEBUG instance == 0
[15:55] IMDB_DEBUG toput_result == PRIVMSG #test
[15:55] IMDB_DEBUG no arg passed, show help
But nothing in the channel.

The bot is opped in the chan, so there is no reason it cant speak in it.

I have tv.com.tcl set up on this bot and it works just fine, no problems responding in the channel.
L
Luniz2k1
Voice
Posts: 19
Joined: Wed Sep 17, 2003 12:32 am

Post by Luniz2k1 »

Well, finally got it working. There was 1 channel it was set to join, but did not have the password set to join the channel. It was in all of the other channels that it was set to join. But !imdb would not work until it was in all channels that it was set to join.
O
OV2
Voice
Posts: 35
Joined: Sat Jan 21, 2006 3:54 pm
Contact:

Post by OV2 »

Nice to know - if I get bored I'll try to figure out why this happens :)
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Bugs and requests :)

Post by rosc2112 »

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 :)
O
OV2
Voice
Posts: 35
Joined: Sat Jan 21, 2006 3:54 pm
Contact:

Post by OV2 »

Hi rosc,

If I understand you correctly, the output appears in the right channel, but lines that are the same for multiple searches appear out of order?
I don't have that much time today, but I'll look into it tomorrow.

Thanks for bringing it to my attention - I only use the script on one channel so it didn't happen to me yet :)
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

That is correct. Just for reference, this is what I have for the 'set announce(IMDBIRC) var:

Code: Select all

set announce(IMDBIRC) "%bold%title%bold - %url\n \
%boldTagline :%bold %tagline \n \
%boldGenre   :%bold %genre \n \
%boldAwards  :%bold %awards \n \
%boldRating  :%bold %rating (%votes votes) \n \
%boldDirector:%bold %name \n \
%boldRuntime :%bold %time mins.\n \
%boldCountry :%bold %country\n \
%boldLanguage:%bold %language\n \
%boldBudget  :%bold %budget\n \
%boldPlot    :%bold %plot \
"
Ohh I just remembered I changed the order a bit last night, but you get the idea :)

I also added

Code: Select all

if {[regexp N/A $line]} {
                        #putcmdlog "line $line"
                        continue
                } else {
                        puthelp "$toput :$line"
So that is why "N/A" lines did not appear in the sample output.

I ust tested it with the default announce(IMDBIRC) line to check that it wasn't my particular string causing the problem. It still behaved the same with the default.
O
OV2
Voice
Posts: 35
Joined: Sat Jan 21, 2006 3:54 pm
Contact:

Post by OV2 »

Hi rosc2112,

I'm still at work so I did not yet check the script, but something just popped into my head: do you allow identical entries in your queues?
(the "set double-help 1" line in the eggdrop config file)
If not, that might be causing the mix-up.

I'll still take a look at the script when I'm home.
O
OV2
Voice
Posts: 35
Joined: Sat Jan 21, 2006 3:54 pm
Contact:

Post by OV2 »

OK I've updated the directors search to include multiple directors and included your awards option (I hope you don't mind). I don't understand why you check the awards string for a colon - I've yet to find one in the awards on imdb...

The option to remove the N/A lines is nice, but it only works if every info-part is on it's own line. Otherwise the whole line gets removed if only one is unavailable - so anyone who wants this will have to build their own method :wink: .

I'm working on the cast list, I'll let you know when it works :)

The problem with multiple channels does not happen to me - I've tried it in two channels and the requests are processed one after the other...
Do you have tcl threads enabled/disabled? Does your bot complete the output on one channel and then start the next channel output or do the lines come out at the same time?
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

I basically copied the other functions to get the awards strings, and not knowing fully what I'm doing would explain the lack of optimization and why the "string last :" line is in there ;)

I've been trying to figure out a way to drop the N/A lines before they're put into the final 'puthelp $toput :$line' cmd, haven't figured out an elegant way to do that yet, but then I took a few days off. Will figure out something and post it =)

I do have tcl threads enabled in the compile. From various tests, the output appears on both channels at the same time. I did have set double-help 0, just tried it with it set at 1, rehashed, retested, same result with msgs appearing out of order.

And now that I think of it, I tested the weather script just to see if that did it as well, and damn it does... So I guess this isn't a script thing, its an eggdrop thing in general... Weird...

Is this because of having threaded tcl enabled? Or is this a eggdrop, or tcl bug?
d
darkwing
Voice
Posts: 1
Joined: Sun May 14, 2006 10:05 am

Post by darkwing »

there is a bug when bot is displaying a line with a http link in it. it just cuts the line where the link begins. try with the movie domino.

edit: overfiends script is what i use :)

Code: Select all

Tagline: I Am a Bounty Hunter - Synopsis: A recounting of
O
OV2
Voice
Posts: 35
Joined: Sat Jan 21, 2006 3:54 pm
Contact:

Post by OV2 »

I just checked - I have threads enabled in the eggdrop compile, but my tcl lib is compiled without thread support, so that could be why I do not encounter this behaviour.
Did you restart eggdrop after enabling duplicate queue entries?
If it still happens after that it's probably an eggdrop issue with multiple script instances adding lines into the same queue.
If you don't want to disable threads I can try to include some sort of syncronization into the script - but it'll probably take some time :)
O
OV2
Voice
Posts: 35
Joined: Sat Jan 21, 2006 3:54 pm
Contact:

Post by OV2 »

I've made a beta version with all the changed stuff - I'll update the normal version if it works fine for a couple of days.
Beta version

Darkwing the bug you reported has been fixed - thanks.
The cast list has also been included, with an option to limit the output.

Thanks for your feedback.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

OV2 wrote:I just checked - I have threads enabled in the eggdrop compile, but my tcl lib is compiled without thread support, so that could be why I do not encounter this behaviour.
Hmm, I don't remember what compile options I used for tcl, I'm assuming whatever the defaults were, since I usually make a .doconf.sh file to run configure with any extra options, and save those files for later. Just checked with 'nm' and see thread symbols, so I think thats a "yes" ;)
Did you restart eggdrop after enabling duplicate queue entries?
If it still happens after that it's probably an eggdrop issue with multiple script instances adding lines into the same queue.


Just tried it with a restart, and yeah it still does the same.. Guess I should make an enquiry on eggheads's site to see if there's a fix for this, since its not just this one script.

Thanks much for working on the script :)
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

Ohh, just another note, the script isn't tcl-special-char safe, I just did a quick test and it chokes on @ chars.. Surprising it didn't choke on { and [ ;)
Post Reply