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
f
fr3n
Voice
Posts: 16
Joined: Fri Dec 02, 2005 10:06 am

Post by fr3n »

sAnexeh wrote:
creasy wrote:Thank you, that fixed it! For some reason I still had this code..
That's old code! ;). Maybe spithash can add some fixes in the imdb.tcl he is hosting, otherwise I'll update it and put it somewhere.
That would be very much appreciated sAnexeh. Thank you.
s
sAnexeh
Voice
Posts: 17
Joined: Thu Dec 05, 2013 6:36 am

Post by sAnexeh »

I just noticed the site hosted by spithash doesn't work. I didn't realize this, sorry! The domain bsdunix.info isn't registered anymore, so I doubt it will come back online anytime soon :roll:.

I've updated the script and put it online here: https://tcl.sanexeh.nl/imdb.tcl
c
creasy
Voice
Posts: 24
Joined: Sat Mar 05, 2016 4:21 am

Post by creasy »

sAnexeh wrote:I've updated the script and put it online here: https://tcl.sanexeh.nl/imdb.tcl
Thank you!
f
fr3n
Voice
Posts: 16
Joined: Fri Dec 02, 2005 10:06 am

Post by fr3n »

sAnexeh wrote:I just noticed the site hosted by spithash doesn't work. I didn't realize this, sorry! The domain bsdunix.info isn't registered anymore, so I doubt it will come back online anytime soon :roll:.

I've updated the script and put it online here: https://tcl.sanexeh.nl/imdb.tcl
Big thanks! Dank u! ;)
f
fr3n
Voice
Posts: 16
Joined: Fri Dec 02, 2005 10:06 am

Post by fr3n »

I'm using that tcl on an eggdrop which is installed on a OVH server, the titles are in French. How do i get it in English please?

!imdb the black knight
<@Mr_T> Le serment du chevalier noir (1954) http://imdb.com/title/tt0046786/
<@Mr_T> RATiNG: 5.2/10 (from 521 users) RUNTiME: 85
<@Mr_T> GENRE: Adventure
s
sAnexeh
Voice
Posts: 17
Joined: Thu Dec 05, 2013 6:36 am

Post by sAnexeh »

fr3n wrote:I'm using that tcl on an eggdrop which is installed on a OVH server, the titles are in French. How do i get it in English please?
According to IMDb this should work:
Please also remember that if you access the site through the following URL, you will always see films listed under their original titles regardless of your login status or site preferences: http://akas.imdb.com
This was changed in imdb.tcl in 2011 by znuff. Can you confirm you're using the following (latest) code:

Code: Select all

set imdburl "http://akas.imdb.com"
set imdbsearchurl "http://akas.imdb.com/find?s=tt&exact=false&"
edit: if you are running the latest version, make sure you didn't forget to rehash/restart your eggdrop config, it should say "IMDB Info Version 25.03.2016: LOADED" when you rehash

If it still doens't work, can you perhaps enable debug (set IMDB_DEBUG 1 in imdb.tcl) and paste the output of logging when doing a lookup of a movie?
f
fr3n
Voice
Posts: 16
Joined: Fri Dec 02, 2005 10:06 am

Post by fr3n »

I grabbed your file and it says;

set imdburl "http://akas.imdb.com"
set imdbsearchurl "http://akas.imdb.com/find?s=tt&exact=false&"

When I rehash I see;

IMDB Info Version 25.03.2016: LOADED


Everything looks OK.

Debug gives me the following;

Code: Select all

[12:28:32] IMDB_DEBUG toput_result == PRIVMSG #fren
[12:28:32] IMDB_DEBUG searchString: "the%20black%20knight"
[12:28:32] IMDB_DEBUG http://akas.imdb.com/find?s=tt&exact=false&q=the%20black%20knight
[12:28:32] IMDB_DEBUG redirect 1
[12:28:32] IMDB_DEBUG no exact match - displaying first title on page
[12:28:32] IMDB_DEBUG redirect 1 = http://akas.imdb.com/title/tt0046786/
[12:28:34] IMDB_DEBUG title == Le serment du chevalier noir (1954)
[12:28:34] IMDB_DEBUG aka == Le serment du chevalier noir
[12:28:34] IMDB_DEBUG director == Tay Garnett
[12:28:34] IMDB_DEBUG writer == Alec Coppel (original screenplay),             Dennis O'Keefe (additional dialogue)            |1 more credit
[12:28:34] IMDB_DEBUG release date == 1 July 1955 (France)
[12:28:34] IMDB_DEBUG genre == Adventure
[12:28:34] IMDB_DEBUG tagline == New excitement ! New thrills ! Alan Ladd's biggest adventure !
[12:28:34] IMDB_DEBUG plot == As a blacksmith John can't hope to win the hand of Linet, daughter of the Earl of Yeonil. Off he goes to prove himself a noble knight. He makes himself a suit of armor with a winged chicken helmet and runs around fighting for King Arthur as the Black Knight. Evil doings include plots by visiting kings and a Druid sacrificial ceremony at Stonehenge.
[12:28:34] IMDB_DEBUG keywords == king                        || knight                        || king arthur                        || stonehenge                        || blacksmith            || See All (43)
[12:28:34] IMDB_DEBUG awards == N/A
[12:28:34] IMDB_DEBUG comment == N/A
[12:28:34] IMDB_DEBUG rating == 5.2 | votes == 522 | rating bar == %color14[%color7*****%color7-----%color14]%color
[12:28:34] IMDB_DEBUG top250 == top/bottom:N/A
[12:28:34] IMDB_DEBUG mpaa == N/A
[12:28:34] IMDB_DEBUG runtime == 85
[12:28:34] IMDB_DEBUG country ==         UK
[12:28:34] IMDB_DEBUG language ==         English
[12:28:34] IMDB_DEBUG movie_color == Color(Technicolor)
[12:28:34] IMDB_DEBUG aspect_ratio == 1.37 : 1
[12:28:34] IMDB_DEBUG soundmix ==         Mono(Western Electric Recording)
[12:28:34] IMDB_DEBUG cert == N/A
[12:28:34] IMDB_DEBUG film_locations == Black Park, Iver Heath, Buckinghamshire, England, UK
[12:28:34] IMDB_DEBUG company == N/A
[12:28:34] IMDB_DEBUG cast_multiline == Cast overview, first billed only: Alan Ladd ... John Patricia Medina ... Linet André Morell ... Sir Ontzlake (as Andre Morell) Harry Andrews ... Earl Of Yeonil Peter Cushing ... Sir Palamides Anthony Bushell ... King Arthur Laurence Naismith ... Major Domo Patrick Troughton ... King Mark Bill Brandon ... Bernard Ronald Adam ... The Abbot Basil Appleby ... Sir Hal Thomas Moore ... The Apprentice Jean Lodge ... Queen Guenevere Pauline Jameson ... Lady Yeoni
[12:28:34] IMDB_DEBUG cast_line == Cast overview, first billed only: Alan Ladd ... John Patricia Medina ... Linet André Morell ... Sir Ontzlake (as Andre Morell) Harry Andrews ... Earl Of Yeonil Peter Cushing ... Sir Palamides Anthony Bushell ... King Arthur Laurence Naismith ... Major Domo Patrick Troughton ... King Mark Bill Brandon ... Bernard Ronald Adam ... The Abbot Basil Appleby ... Sir Hal Thomas Moore ... The Apprentice Jean Lodge ... Queen Guenevere Pauline Jameson ... Lady Yeonil Joh
[12:28:34] IMDB_DEBUG budget == N/A
[12:28:34] IMDB_DEBUG screens == N/A
I think IMDB uses geolocation;
Default Title Display: For users that are not logged into www.imdb.com, and as the default for our registered users who have not selected a preference - we will display the localized version of the title they are looking for based on their geo-location. Users in France will see the title as released in France.
http://www.imdb.com/help/show_leaf?sitepreferences
s
sAnexeh
Voice
Posts: 17
Joined: Thu Dec 05, 2013 6:36 am

Post by sAnexeh »

fr3n wrote:[12:28:34] IMDB_DEBUG title == Le serment du chevalier noir (1954)
[12:28:34] IMDB_DEBUG release date == 1 July 1955 (France)

I think IMDB uses geolocation;
I think you are right. No idea why akas.imdb.com does this as they clearly state it should output in English only. I guess they changed their mind or they simply forgot.

I was able to fix this issue by using X-FORWARDED-FOR in the request headers to akas.imdb.com. I've also fixed some other small (performance) issues and changed the default announce setting to what I'm using because I cba to change it to default every time I need to fix something :lol:

For you the new setting "Language_IP" is relevant in imdb.tcl. I hope I made it easy enough for you ;)

I've updated the script and put it online here: https://tcl.sanexeh.nl/imdb.tcl
T
Taken
Voice
Posts: 7
Joined: Mon Jul 26, 2010 5:51 pm

Post by Taken »

Hello,

Is it possible to fix awards? It shows "N/A" (and only in log debug) for films that have them.

Thanks!
s
sAnexeh
Voice
Posts: 17
Joined: Thu Dec 05, 2013 6:36 am

Post by sAnexeh »

Taken wrote:Hello,

Is it possible to fix awards? It shows "N/A" (and only in log debug) for films that have them.

Thanks!
I hope so! All I could find for awards without doing an additional lookup is something like "Nominated for 2 Oscars. Another 1 win & 4 nominations". I hope that's what you were looking for.

I've updated the script and put it online here: https://tcl.sanexeh.nl/imdb.tcl

Give it a try and let me know if it works out.
T
Taken
Voice
Posts: 7
Joined: Mon Jul 26, 2010 5:51 pm

Post by Taken »

Yes, it's enough!

Now... two little format fix for $mcolor :

Color|BlackandWhite to Color | Black and White

And $plot (with more than 700 chars) which cuts lines without \n really.

Thanks!
s
sAnexeh
Voice
Posts: 17
Joined: Thu Dec 05, 2013 6:36 am

Post by sAnexeh »

Taken wrote:Now... two little format fix for $mcolor :
Color|BlackandWhite to Color | Black and White
I've updated the script. %mcolor should be fixed now. If it isn't, could you give me the name of the movie you're experiencing trouble with?
Taken wrote:And $plot (with more than 700 chars) which cuts lines without \n really.
I don't know what you mean by this. Could you elaborate on this? What movie, what happens, etc?

On a general note, I also fixed %country, %language and %soundmix (applied trim), %wcredits, %keywords, %country, and %language (removed extra spaces) and %company (which was broken in general)

I've updated the script and put it online here: https://tcl.sanexeh.nl/imdb.tcl
X
Xplor3r
Voice
Posts: 1
Joined: Fri Sep 02, 2016 2:15 pm

Post by Xplor3r »

I got the latest code, but when using imdb command on channel still shows 2011 version. why?
s
sAnexeh
Voice
Posts: 17
Joined: Thu Dec 05, 2013 6:36 am

Post by sAnexeh »

Xplor3r wrote:I got the latest code, but when using imdb command on channel still shows 2011 version. why?
Are you sure you loaded the correct script? Is it correctly configured in eggdrop.conf? When you telnet to the eggdrop and type .rehash after logging in you should see a message like "[19:03] IMDB Info Version 13.08.2016: LOADED"
User avatar
Madalin
Master
Posts: 310
Joined: Fri Jun 24, 2005 11:36 am
Location: Constanta, Romania
Contact:

Post by Madalin »

Another script for does interested is:

Code: Select all

# +-------------------------------------------------------------------------------------+
# |                                                                                     |
# |                         iMDB v1.0.0                                                 |
# |                                                                                     |
# +-------------------------------------------------------------------------------------+
# |                                                                                     |
# | *** Website             @  http://www.EggdropTCL.com                                |
# | *** GitHub              @  http://github.com/MadaliNTCL/eggdrop-tcl                 |
# |                                                                                     |
# +-------------------------------------------------------------------------------------+
# | *** IRC Support:                                                                    |
# |                    #EggdropTCL     @ QuakeNET                                       |
# |                    #EggdropTCL     @ UnderNET                                       |
# |                    #EggdropTCL     @ EfNET                                          |
# |                                                                                     |
# | *** Contact:                                                                        |
# |                    Yahoo Messenger/Mail: madalinmen28@yahoo.com                     |
# |                    Google Mail         : madalinmen28@gmail.com                     |
# |                    Skype Messenger     : madalinmen28                               |
# |                                                                                     |
# +-------------------------------------------------------------------------------------+
# + *** Commands ***                                                                    |
# |     +---------------+                                                               |
# |     [ OP - PUBLIC   ]                                                               |
# |     +---------------+                                                               |
# |                                                                                     |
# |     +++ !imdb <on/off>                                                              |
# +-------------------------------------------------------------------------------------+

bind PUBM - * imdb
bind PUBM - * imdb:pubm

package require json
package require http
package require tdom

setudef flag imdb

proc imdb:pubm {nick uhost hand chan arg} {
	global temp

	if {[string index $arg 0] in {! . `}} {
		set temp(cmd) [string range $arg 1 end]
		set temp(cmd) [lindex [split $temp(cmd)] 0]
		set arg [join [lrange [split $arg] 1 end]]
	} elseif {[isbotnick [lindex [split $arg] 0]]} {
		set temp(cmd) [lindex [split $arg] 1]
		set arg [join [lrange [split $arg] 2 end]]
	} else { return 0 }

	if {[info commands imdb:$temp(cmd)] ne ""} { imdb:$temp(cmd) $nick $uhost $hand $chan $arg }
}

proc imdb:imdb {nick uhost hand chan arg} {
	global imdb iignore
	
	switch -exact -- [lindex [split $arg] 0] {
		on {
			if {[isop $nick $chan]} {
				channel set $chan +imdb
				
				putserv "PRIVMSG $chan :\002$nick\002 - \00302Set channel mode \00306+imdb\0032 on \00304$chan"
			}
		}
		off {
			if {[isop $nick $chan]} {
				channel set $chan -imdb
				
				putserv "PRIVMSG $chan :\002$nick\002 - \00302Set channel mode \00306-imdb\0032 on \00304$chan"
			}
		}		
	}
}
	
proc imdb {nick uhost hand chan arg} {
	global imdb iignore
	
	if {![channel get $chan imdb]} { return }
	
	## ++
	set floodtime 10

	## ++ 
	if {![info exists iignore($nick)]} {
		set iignore($nick) [unixtime]
		utimer $floodtime [list unset -nocomplain iignore($nick)]
	}

	## ++ 
	if {[expr [unixtime]-$iignore($nick)]>$floodtime} { putlog "ignoram"; return 0 }
	
	regexp -all -nocase {(tt[0-9]{7})} $arg match imdbid

	if {[catch {http::geturl http://www.omdbapi.com/?[http::formatQuery i $imdbid]} tok]} {
		putlog "Socket error: $tok"
		return 0
	}
	if {[http::status $tok] ne "ok"} {
		set status [http::status $tok]
		
		putlog "TCP error: $status"
		return 0
	}
	if {[http::ncode $tok] != 200} {
		set code [http::code $tok]
		http::cleanup $tok

		putlog "HTTP Error: $code"
		return 0
	}

	set data [http::data $tok]

	set parse [::json::json2dict $data]

	set year [dict get $parse Year]
	set title [dict get $parse Title]
	set runtime [dict get $parse Runtime]
	set genre [dict get $parse Genre]
	set rating [dict get $parse imdbRating]
	set votes [dict get $parse imdbVotes]
	set plot [dict get $parse Plot]
	set awards [dict get $parse Awards]

	putserv "PRIVMSG $chan :\0031,8\002iMDB\002\003 - \00312$title\003 \037\[\037$runtime ($year)\037\]\037 \037\002/\002\037 \00306$genre\003 \037\002/\002\037 \002$rating\002 (\00302Votes\003: \00304$votes\003) \037\002/\002\037 Plot: \00310$plot\003 \037\002/\002\037 \00302Awards\003: \00304$awards"
}

putlog "++ \[ - \00304PUBLIC\003 - \00306loaded\003 * \00303iMDB\003 \]"
is triggered when imdb links are posted in the channel
Post Reply