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
b
bl4s
Voice
Posts: 4
Joined: Fri Feb 23, 2007 8:07 pm

Post by bl4s »

hi i tired both

http://overfiend.sessionclan.de/scripts/imdb.html
http://members.dandy.net/~fbn/imdb.2112.tcl.txt

none of them works, eggdrop 1.6.18

now iam trying the 2nd one with curl

my code is:

Code: Select all

###############################################################################
# Output Configs:
#
# COOKIES ARE :
# =============
# TITLE             = %title      |    BOLD           = %bold
# URL               = %url        |    UNDERLINE      = %uline
# DIRECTOR          = %name       |    COLORS         = %color#,#
# GENRE             = %genre      |    NEW LINE       = \n
# SYNOPSIS          = %plot       |-----------------------------
# RATING            = %rating     |    !! to reset color code !!
# RATING_BAR        = %rbar       |    !! use %color w/o args !!
# VOTES             = %votes      |
# RUNTIME           = %time       |
# AWARDS            = %awards     |
# BUDGET            = %budget     |
# SCREENS           = %screens    |
# TAGLINE           = %tagline    |
# MPAA              = %mpaa       |
# COUNTRY           = %country    |
# LANGUAGE          = %language   |
# SOUND MIX         = %soundmix   |
# TOP 250           = %top250     |
# CAST LINES        = %castmline  |
# WRITING CREDITS   = %wcredits   |

# rating bar colors
# bracket color:
set barcol1 "14"
# star colors:
set barcol2 "7"

# Number of Cast/actor names to return (castmline) (0 means no limit)
set cast_linelimit "5"

#
#
# RANDOMIZING OUTPUT :
# ====================
# Exemple:
#  set random(IMDBIRC-0)       "IMDB info for %bold%title%bold Directed by %name"
#  set random(IMDBIRC-1)       "IMDB info for %title Directed by %bold%name%bold"
#  set random(IMDBIRC-2)       "IMDB info for %title Directed by %name"
# TYPE --------^   ^
#       ID --------^
#
#  set announce(IMDBIRC) "random 3"
# TYPE ---------^        ^    ^
#       RANDOM ----------^    ^
#           # OF IDS ---------^
#
# exemple random announces:
# set announce(IMDBIRC) "random 3"
# set random(IMDBIRC-0) "IMDB info for %bold%title%bold Directed by %name -> rated %uline%rating%uline (%votes votes) - genre: %genre - runtime: %time mins >> URL: %uline%url%uline >> Budget: %budget >> Screens: (USA) %screens"
# set random(IMDBIRC-1) "TITLE: %bold%title%bold - DIRECTOR: %name - RATE: %rating by %votes users - GENRE: %genre - RUNTIME: %time mins - URL: %url - BUDGET: %budget - SCREENS: (USA) %screens"
# set random(IMDBIRC-2) "%bold%title%bold - %url\n%boldDirected by:%bold %name\n%boldGenre:%bold %genre\n%boldTagline:%bold %tagline\n%boldSynopsis:%bold %plot\n%boldRating:%bold %rating (%votes votes) top 250:%bold%top250%bold\n%boldMPAA:%bold %mpaa\n%boldRuntime:%bold %time mins.\n%boldCountry:%bold %country\n%boldLanguage:%bold %language\n%boldSound Mix:%bold %soundmix\n%boldBudget:%bold %budget \n%boldOpening Weekend:%bold (USA) %screens"
#
# example normal announce:
#set announce(IMDBIRC) "%bold%title%bold - %url\nGenre: %genre\nTagline: %tagline\nSynopsis: %plot\nRating: %rating (%votes votes) %rbar  %color3%top250%color\nAwards: %awards\nRuntime: %time mins."



# This is what I use  -Rosc
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) %rbar %top250 \n \
%boldMPAA    :%bold %mpaa \n \
%boldDirector:%bold %name \n \
%boldWriter  :%bold %wcredits \n \
%boldRuntime :%bold %time \n \
%boldCountry :%bold %country\n \
%boldLanguage:%bold %language\n \
%boldBudget  :%bold %budget\n \
%bold1st week:%bold %screens\n \
%boldSound   :%bold %soundmix \n \
%boldPlot    :%bold %plot \n \
%boldCast    :%bold (Showing first $cast_linelimit only)\n%castmline\
"

# end output config section
#####################################################################################
# Other Configs:

# Channels to allow public use in:
set imdbchans "#xxx"

# http connection timeout (milliseconds - 1/1000ths sec.)
set imdb_timeout "30000"

# flood-control:
set queue_enabled 1
# max requests:
set queue_size 5
# per ? seconds:
set queue_time 30

# for in-channel .imdb request: (1) == send output to channel   (0) send output to PRIVMSG
set pub_or_not 1


# You can choose to use the http package, or the program 'curl' for grabbing the html data 
# (maybe this should use the socket code instead of curl? meh, I'm too lazy to port it -rosc)
# set IMDB_ALTERNATIVE 0 = use the internal tcl http 2.3 package
# set IMDB_ALTERNATIVE 1 = use the external curl program
set IMDB_ALTERNATIVE 1

# set here the location path where to find 'curl' if using IMDB_ALTERNATIVE 1
set binary(CURL) "/usr/local/bin/curl"

#################################################################
# DO NOT MODIFY BELOW HERE UNLESS YOU KNOW WHAT YOU ARE DOING!  #
#################################################################

if { $IMDB_ALTERNATIVE == 0 } {package require http 2.3}

bind pub -|- .imdb imdb_proc

set instance 0
set warn_msg 0

proc htmlcodes {tempfile} {
	set mapfile [string map {" ' & & [ ( \ / ] ) { ( } ) £ £ ¨ ¨ © © « « ­ ­ ® ® ¡ ¡ ¿ ¿} $tempfile]
	set mapfile [string map {´ ´ · · ¹ ¹ » » ¼ ¼ ½ ½ ¾ ¾ À À Á Á Â Â } $mapfile]
	set mapfile [string map {Ã Ã Ä Ä Å Å Æ Æ Ç Ç È È É É Ê Ê Ë Ë Ì Ì Í Í Î Î Ï Ï Ð Ð Ñ Ñ Ò Ò Ó Ó Ô Ô Õ Õ Ö Ö } $mapfile]
	set mapfile [string map {× × Ø Ø Ù Ù Ú Ú Û Û Ü Ü Ý Ý Þ Þ ß ß à à á á â â ã ã ä ä å å æ æ ç ç è è é é ê ê } $mapfile]
	set mapfile [string map {ë ë ì ì í í î î ï ï ð ð ñ ñ ò ò ó ó ô ô õ õ ö ö ÷ ÷ ø ø ù ù ú ú û û ü ü ý ý þ þ } $mapfile]
	set mapfile [string map {  "" & "&"} $mapfile]
	return $mapfile
}

proc replacevar {strin what withwhat} {
	set output $strin
	set replacement $withwhat
	set cutpos 0
	while { [string first $what $output] != -1 } {
		set cutstart [expr [string first $what $output] - 1]
		set cutstop  [expr $cutstart + [string length $what] + 1]
		set output [string range $output 0 $cutstart]$replacement[string range $output $cutstop end]
	}
	return $output
}

proc findnth {strin what count} {
	set ret 0
	for {set x 0} {$x < $count} {incr x} {
		set ret [string first $what $strin [expr $ret + 1]]
	}
	return $ret
}

proc imdb_proc { nick uhost handle chan arg } {
	global cast_linelimit instance queue_size queue_time queue_enabled IMDB_ALTERNATIVE
	global imdb_timeout barcol1 barcol2 pub_or_not announce random warn_msg binary 
	# channel_check permission
	if {[lsearch -exact $::imdbchans $chan] == -1} {return}
	# public or private
	if {$pub_or_not == 1 } {
		set toput "PRIVMSG $chan" 
	} else {
		set toput "PRIVMSG $nick" 
	}
	# if no arg passed, show help
	if {$arg == ""} {
		
		puthelp "$toput :IMDb \002Syntax: .imdb <movie title>\002  exemple: .imdb Beautiful Mind"
		return
	}
	#flood-control
	if {$queue_enabled == 1} {
		#flooded?
		if { $instance >= $queue_size } {
			if { $warn_msg == 0 } {
				set warn_msg 1
				putquick "$toput :Flood-Control: Request for \"$arg\" from user \"$nick\" will not be answered."
				putquick "$toput :Flood-Control: Maximum of $queue_size requests every $queue_time seconds."
				utimer 120 wmsg
			}
			return
		}
		incr instance
		utimer [set queue_time] decr_inst
	}
	# initial search
	set imdburl "http://www.imdb.com"
	set imdbsearchurl "http://akas.imdb.com/find?tt=on;nm=on;mx=5;"
	set searchString [string map {\  %20 & %26 , %2C . %20} $arg]

	if { $IMDB_ALTERNATIVE == 0 } {

		set page [::http::config -useragent "MSIE 6.0"]
		catch {set page [::http::geturl ${imdbsearchurl}q=$searchString -timeout $imdb_timeout]} error
		if {[string match -nocase "*couldn't open socket*" $error]} {
			puthelp "$toput :Error - couldn't connect..Try again later"
			::http::Finish $page
			return
		}
		if {[::http::status $page] == "timeout"} {
			puthelp "$toput :\002Connection to imdb.com timed out while doing initial search.\002"
			::http::Finish $page
			return
		}
		set html [::http::data $page]
		::http::Finish $page
	} else {
		catch { exec $binary(CURL) "${imdbsearchurl}q=$searchString" } html
	}

	#if redirect necessary, find first link and redirect
	if {([regexp {<title>IMDb.*Search} $html] == 1)} {
		set ttcode "0000001"
		set start "0"
		#start from the headline
		regexp -indices {<h1>IMDb.*Search</h1>} $html start
		set temp [string range $html [lindex $start 1] end]
		#dealing with different search results
		set hit 0
		if { [regexp -indices {Popular Titles} $temp tstart] } {
			set temp2 [string range $temp [lindex $tstart 1] end]
			regexp {<a.*?>(.*?)</a>} $temp2 dummy title
			if { [string equal -nocase $title $arg] } {
				set temp $temp2
				set hit 1
			}
		}
		if { $hit == 0 } {
			if { [regexp -indices {Exact Matches} $temp start] } {
				#putcmdlog "start1 $start"
			} elseif { [regexp -indices {Titles} $temp start] } {
				#putcmdlog "start2 $start"
			} else {
				puthelp "$toput :No useful results."
				return
			}
			set temp [string range $temp [lindex $start 1] end]
		}
		#searching for first ttcode
		if {[regexp {/title/tt[0-9]+} $temp ttcode]} {
			set pos [string last / $ttcode] ; incr pos
			set ttcode [string range $ttcode $pos end]
		}
		# for bogus ttcode
		if { $ttcode == "0000001" } {
			puthelp "$toput :Sorry, I couldn't find that title.."
			return
		}
		set newurl "$imdburl/title/$ttcode/"
		# get the page redirected to
		unset html

		if {$IMDB_ALTERNATIVE == 0} {
			set page [::http::config -useragent "MSIE 6.0"]
			catch {set page [::http::geturl $newurl -timeout $imdb_timeout]} error
			if {[string match -nocase "*couldn't open socket*" $error]} {
				puthelp "$toput :Error: couldn't connect..Try again later"
				::http::Finish $page
				return
			}
			if {[::http::status $page]=="timeout"} {
				puthelp "$toput :\002Connection to imdb.com timed out.\002"
				::http::Finish $page
				return
			}
			set html [::http::data $page]
			::http::Finish $page
		} else {
			catch { exec $binary(CURL) "$newurl" } html
		}

	# if no redirect happened, then get first page on match
	} else {
		set location ""

		if { $IMDB_ALTERNATIVE == 0 } {
			upvar 0 $page oldpage
			regexp {title/tt[0-9]+/} $oldpage(meta) location
		} else {
			set result [catch { exec $binary(CURL) -i "${imdbsearchurl}q=$searchString" } oldpage]
			regexp {title/tt[0-9]+/} $oldpage location
		}

		set newurl "$imdburl/$location"
		if { $location != "" } {
			if { $IMDB_ALTERNATIVE == 0 } {
				unset html
				set page [::http::config -useragent "MSIE 6.0"]
				catch {set page [::http::geturl $newurl -timeout $imdb_timeout]} error
				if {[string match -nocase "*couldn't open socket*" $error]} {
					puthelp "$toput :Error: couldn't connect..Try again later"
					::http::Finish $page
					return
				}
				if {[::http::status $page]=="timeout"} {
					puthelp "$toput :\002Connection to imdb.com timed out.\002"
					::http::Finish $page
					return
				}
				set html [::http::data $page]
				::http::Finish $page
			} else {
				unset html
				catch { exec $binary(CURL) "$newurl" } html
			}

		} else {
			puthelp "$toput :I can't find that title..Sorry.."
			return
		}
	}
	# for bogus searches
	if {[string length $newurl] == 0} {
		puthelp "$toput :Sorry, I can't find that title.."
		return
	}
	# decide on output
	if { ! [string compare [lindex $announce(IMDBIRC) 0] "random"] && [string is alnum -strict [lindex $announce(IMDBIRC) 1]] == 1 } {
		set output $random(IMDBIRC\-[rand [lindex $announce(IMDBIRC) 1]])
	} else {
		set output $announce(IMDBIRC)
	}
	# collect output
	set title "N/A" ; set name "N/A" ; set genre "N/A" ; set tagline "N/A"
	set plot "N/A" ; set rating "N/A" ; set votes "N/A" ; set mpaa "N/A"
	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 ""; set awards "N/A"
	set rating_bar ""; set cast_multiline "N/A"; set wcredits "N/A"
	## get title
	if {[regexp {<title>[^<]+} $html title]} {
		set pos [expr [string last > $title] + 1]
		set title [string range $title $pos end]
		set title [htmlcodes $title]
	}
	## get director
	if {[regexp {<h5>Directed by</h5>\n(.*?)\n} $html dummy name]} {
		set name [string map {(more) "" <br>  ""} $name]
		set name [string map {<br/> " -\ "} $name]
		regsub -all {<[^>]+>} $name {} name
		set name [htmlcodes $name]
	}
	## get writing credits
	if {[regexp {<h5>Writing credits.*?</h5>(.*?)<br/>\n} $html dummy wcredits]} {
		regsub {\n} $wcredits {} wcredits
		regsub {>more<} $wcredits {} wcredits
		set wcredits [string map {(more) "" <br>  ""} $wcredits]
		set wcredits [string map {"&<br>" "& " <br/> " -\ "} $wcredits]
		regsub -all {<[^>]+>} $wcredits {} wcredits
		set wcredits [htmlcodes $wcredits]
	}
	## get genre
	if {[regexp {<a href=./Sections/Genres[^\n]+} $html genre]} {
		regsub {>more<} $genre {} genre
		regsub -all {<[^\>]*>} $genre {} genre
		regsub {\(.*\)} $genre {} genre
	}
	## get tagline
	if {[regexp {<h5>Tagline:</h5>(.*?)<.*?>} $html dummy tagline]} {
		regsub -all {<[^\>]*>} $tagline {} tagline
		set tagline [string trim $tagline]
		set tagline [htmlcodes $tagline]
	}
	## get plot
	if { [regexp {<h5>Plot Outline:</h5>(.*?)</div>} $html dummy plot] || [regexp {<h5>Plot Summary:</h5>(.*?)</div>} $html dummy plot] } {
		regsub {\n} $plot {} plot
		regsub {>more<} $plot {} plot
		set plot [string map {(more) "" "(view trailer)" "" } $plot]
		regsub -all {<[^\>]*>} $plot {} plot
		set plot [string trim $plot]
		set plot [htmlcodes $plot]
	}
	## get iMDb rating
	if {[regexp {<b>User Rating:</b>.*?<b>(\d.\d/10)</b> \(<a href="ratings">(.*?) votes</a>\)} $html dummy rating votes]} {
		#rating bar code
		set goldstars [expr round(($rating / 10) * 100)]
		set greystars [expr 10 - $goldstars]
		# generating the rating bar
		set marker "*"
		set rating_bar "$barcol1\[$barcol2"
		for {set i2 0} {$i2 < $goldstars} {incr i2 1} {
			set rating_bar "$rating_bar$marker"
		}
		set marker "-"
		set rating_bar "$rating_bar14"
		for {set i3 0} {$i3 < $greystars} {incr i3 1} {
			set rating_bar "$rating_bar$marker"
		}
		set rating_bar "$rating_bar$barcol1\]"
		#end rating bar code
	}
	## get TOP 250
	if {[regexp {>Top 250: (.*?)</a>} $html dummy top250]} {
		set top250 "\002Top 250:\002 $top250"
	} elseif {[regexp {>Bottom 100: (.*?)</a>} $html dummy top250]} {
		set top250 "\002Bottom 100:\002 $top250"
	}
	## get MPAA
	if {[regexp {<a href="/mpaa">.*?</h5>(.*?)</div>} $html dummy mpaa]} {
		regsub -all {\n} $mpaa {} mpaa
		set mpaa [htmlcodes $mpaa]
		set mpaa [string trim $mpaa]
	}
	## get runtime
	if {[regexp {<h5>Runtime:</h5>(.*?)</div>} $html dummy runtime]} {
		regsub -all {\n} $runtime {} runtime
	}
	## get awards
	if {[regexp {<h5>Awards:</h5>(.*?)<a} $html dummy awards]} {
		regsub -all {[\n]} $awards {} awards
		set awards [string trim $awards]
		set awards [string map {& " & "} $awards]
		set awards [htmlcodes $awards]
	}
	## get country
	if {[regexp {<a href=./Sections/Countries[^\n]+} $html country]} {
		regsub -all {<[^\>]*>} $country {} country
	}
	## get language
	if {[regexp {<a href=./Sections/Languages[^\n]+} $html language]} {
		regsub -all {<[^\>]*>} $language {} language
	}
	## get soundmix
	if {[regexp {<a href=./List.sound-mix=[^\n]+} $html soundmix]} {
		regsub -all {<[^\>]*>} $soundmix {} soundmix
	}
	## get cast
	if {[regexp {<table class="cast">(.*?)</div>} $html dummy cast]} {
		regsub -all {<td class=\"nm\">} $cast \n cast_multiline
		regsub -all {<[^\>]*>} $cast_multiline {} cast_multiline
		set cast_multiline [string map {"rest of cast listed alphabetically: " \n} $cast_multiline]
		set cast_multiline [htmlcodes $cast_multiline]
		set cast_multiline [string trim $cast_multiline]
		if { $cast_linelimit > 0 } {
			set nthoccur [expr [findnth $cast_multiline \n $cast_linelimit] - 1]
			if {$nthoccur > 0} {set cast_multiline [string range $cast_multiline 0 $nthoccur]}
		}
	}
	# do we need the second page?
	if {[string match "*%budget*" $output] || [string match "*%screens*" $output]} {
		unset html


		if { $IMDB_ALTERNATIVE == 0 } {
			set page2 [::http::config -useragent "MSIE 6.0"]
			catch {set page2 [::http::geturl ${newurl}business -timeout $imdb_timeout]} error
			if {[string match -nocase "*couldn't open socket*" $error]} {
				puthelp "$toput :Error: couldn't connect..Try again later"
				::http::Finish $page2
				return
			}
			if {[::http::status $page2]=="timeout"} {
				puthelp "$toput :\002Connection to imdb.com timed out.\002"
				::http::Finish $page2
				return
			}
			set html [::http::data $page2]
			::http::Finish $page2
		} else {
			catch { exec $binary(CURL) "${newurl}business" } html
		}

		## get budget
		if {[regexp {<h5>Budget</h5>(.*?)<br/>} $html dummy budget]} {
			regsub {\n} $budget {} budget
			set budget [string map {€ € £ £ } $budget]
		}
		## get screens
		if {[regexp {<h5>Opening Weekend</h5>(.*?)<br/>} $html dummy screens]} {
			regsub -all {\n} $screens {} screens
			regsub -all {<a href.*?>} $screens {} screens
			regsub -all {</a>} $screens {} screens
		}
	}
    ## output results
	set output [replacevar $output "%bold" "\002"]
	set output [replacevar $output "%color" "\003"]
	set output [replacevar $output "%uline" "\037"]
	set output [replacevar $output "%title" $title]
	set output [replacevar $output "%url" $newurl]
	set output [replacevar $output "%name" $name]
	set output [replacevar $output "%genre" $genre]
	set output [replacevar $output "%tagline" $tagline]
	set output [replacevar $output "%plot" $plot]
	set output [replacevar $output "%rating" $rating]
	set output [replacevar $output "%rbar" $rating_bar]
	set output [replacevar $output "%votes" $votes]
	set output [replacevar $output "%top250" $top250]
	set output [replacevar $output "%mpaa" $mpaa]
	set output [replacevar $output "%time" $runtime]
	set output [replacevar $output "%awards" $awards]
	set output [replacevar $output "%country" $country]
	set output [replacevar $output "%language" $language]
	set output [replacevar $output "%soundmix" $soundmix]
	set output [replacevar $output "%budget" $budget]
	set output [replacevar $output "%screens" $screens]
	set output [replacevar $output "%castmline" $cast_multiline]
	set output [replacevar $output "%wcredits" $wcredits]
	foreach line [split $output "\n"] {
		if {![regexp N/A $line]} {
			#putcmdlog "line2 '$line'"
			puthelp "$toput :$line"
		}
	}
}

proc decr_inst { } {
	global instance
	if { $instance > 0 } { incr instance -1 }
}

proc wmsg { } {
	global warn_msg
	set warn_msg 0
}
if { $IMDB_ALTERNATIVE == 0 } { set using "Http Package" } else { set using "Curl" }
putlog "IMDB b+ by OV2 loaded - using \002$using\002"
sometimes its just not answering
sometimes its says in partyline

Tcl error [imdb_handler]: can't read "location": no such variable

pls help
w
w00f
Halfop
Posts: 49
Joined: Wed Oct 04, 2006 6:50 pm

Post by w00f »

try to use http package instead of curl program.

change

Code: Select all

set IMDB_ALTERNATIVE 1 
to

Code: Select all

set IMDB_ALTERNATIVE 0
mine is working 100%
O
OV2
Voice
Posts: 35
Joined: Sat Jan 21, 2006 3:54 pm
Contact:

Post by OV2 »

If you have to use curl, try running curl from the console. Does it display an error message?
b
bl4s
Voice
Posts: 4
Joined: Fri Feb 23, 2007 8:07 pm

Post by bl4s »

hmm the bot just totally ignores me if i type !imdb

no error in partyline aswell..

i tried

set IMDB_ALTERNATIVE 0

and yes curl program is running 100% in console
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

If you're using mine, the command is .imdb, unless you change it in the bind.
O
OV2
Voice
Posts: 35
Joined: Sat Jan 21, 2006 3:54 pm
Contact:

Post by OV2 »

I made a new release today that fixes the bug with the multiline cast and bold/underline/color tags and also introduces a way to suppress the output of those parts of the output that were not found (the N/A stuff) without putting each variable into a seperate line.

Feedback would be nice - especially if something doesn't work :D
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

OV2 wrote:I made a new release today that fixes the bug with the multiline cast and bold/underline/color tags and also introduces a way to suppress the output of those parts of the output that were not found (the N/A stuff) without putting each variable into a seperate line.
Feedback would be nice - especially if something doesn't work :D
Colors still do not come through on castmline, if I understand your note about the color tags and multiline cast, should work together. The only other prob I see is if there is no cast output, there's a blank line being sent, like for the video game "crouching tiger hidden dragon" (I guess that's the first item in imdb's list, it doesn't pull up the movie.)

Otherwise, it looks great. I'm taking my copy offline since yours is better :)
b
bl4s
Voice
Posts: 4
Joined: Fri Feb 23, 2007 8:07 pm

Post by bl4s »

well ye it works now, my only problem is
i wanna hide some stuff, like language cast director etc.

i tried to # in script and i got :)

[09:50] <@dbot> # Director: Amy Heckerling -
[09:50] <@dbot> Writer : Amy Heckerling (written by)
[09:50] <@dbot> Runtime : 97 min
[09:50] <@dbot> # Country : USA
[09:50] <@dbot> # Language: English
[09:50] <@dbot> Budget : $20,000,000 (estimated)
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

According to the notes OV2 put in the script, and the example shown, you're supposed to enclose your tags with || if you want the script to drop lines with N/A, like:

Code: Select all

set announce(IMDBIRC) "%bold%title%bold - %uline%url%uline\n\
|%boldTagline :%bold %tagline|\n\
|%boldGenre   :%bold %genre|\n\
|%boldAwards  :%bold %awards|\n\
|%boldRating  :%bold %rating (%votes votes) %rbar| |%top250|\n\
|%boldMPAA    :%bold %mpaa|\n\
|%boldDirector:%bold %name|\n\
|%boldWriter  :%bold %wcredits|\n\
|%boldRuntime :%bold %time|\n\
|%boldCountry :%bold %country|\n\
|%boldLanguage:%bold %language|\n\
|%boldBudget  :%bold %budget|\n\
|%bold1st week:%bold %screens|\n\
|%boldSound   :%bold %soundmix|\n\
|%boldPlot    :%bold %plot|\n\
|%boldCast    :%bold (Showing first $cast_linelimit only)\n%color10%castmline%color|\
If you don't want certain fields showing at all, don't put the tags for them into the announce(IMDBIRC) setting at all..
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

BTW, OV2, I fixed the blank line prob with this hack:

Code: Select all

        foreach line [split $output "\n"] {
                set line [string trim $line]
                if {$line != ""} {
                        puthelp "$toput :$line"
                }
        }
I can't figure out why the color/bold/underline codes don't work for cast_multiline tho. I'm using the format shown in the previous post.
O
OV2
Voice
Posts: 35
Joined: Sat Jan 21, 2006 3:54 pm
Contact:

Post by OV2 »

Thanks for the feedback!

I fixed both of the mentioned bugs:
The blank line on the end was a forgotten string trim :oops:.
Colors with multiline cast should also work now - I didn't check for numbers with more than one digit and also only for color formats like "4,6".
b
bl4s
Voice
Posts: 4
Joined: Fri Feb 23, 2007 8:07 pm

Post by bl4s »

well

its now

Code: Select all

||%boldAwards  :%bold %awards \n \
||%boldRating  :%bold %rating (%votes votes) %rbar %top250 \n \
||%boldMPAA    :%bold %mpaa \n \
||%boldDirector:%bold %name \n \
||boldWriter  :%bold %wcredits \n \
||boldRuntime :%bold %time \n \
||%boldCountry :%bold %country\n \
||%boldLanguage:%bold %language\n \
||%boldBudget  :%bold %budget\n \
||%bold1st week:%bold %screens\n \
||%boldSound   :%bold %soundmix \n \
||%boldCast    :%bold (Showing first $cast_linelimit only)\n%castmline\
in the file

and now its still displays it like:

[00:05] <@djmellowd> ||boldRuntime : 116 min
[00:05] <@djmellowd> ||Country : USA
[00:05] <@djmellowd> ||Language: English
O
OV2
Voice
Posts: 35
Joined: Sat Jan 21, 2006 3:54 pm
Contact:

Post by OV2 »

Now what exactily do you want to leave out and do you want to hide it completely or simply if there is no information on the imdb page?
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

Poifect! Thank you OV!! :)
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

bl4s wrote:well its now
You didn't read did you... Did my example show || in the format? No.. When I said ||, I said "enclose in ||" not "use || literally."

Try re-reading the notes in the script, and look really really close at the example. Maybe make the font bigger so you can see exactly where the | pipes are being placed. And like I said, if you don't want "runtime" showing at all, DON'T PUT THE TAGS FOR IT IN THE CONFIG LINE.

All the || chars do, is drop the output IF IT'S EMPTY (eg, N/A, no data.)

//sometimes there's no helping human stupidity.//
Post Reply