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 20040110

Old posts that have not been replied to for several years.
Locked
d
dangerko
Voice
Posts: 6
Joined: Wed Jan 05, 2005 5:24 pm

imdb 20040110

Post by dangerko »

hello, when i'm trying to query bot with imdb v. 20040110 script, it writes to party line such messages:

[22:22] Tcl error [imdb_handler]: Unsupported URL type "{http"

whats going on?
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

  • type .set errorInfo
  • post the whole error traceback
  • post relevant part(s) of the script (proc imdb_handler)
use

Code: Select all

 tag when posting code/botlogs
d
dangerko
Voice
Posts: 6
Joined: Wed Jan 05, 2005 5:24 pm

Post by dangerko »

[quote="demond"]
  • type .set errorInfo
  • post the whole error traceback
  • post relevant part(s) of the script (proc imdb_handler)
use

Code: Select all

 tag when posting code/botlogs[/quote]

.set errorInfo doesn't works for me..

the relevant part of the tcl code: (if you want the whole script: http://danger.rulez.sk/imdb.tcl)

[code]
proc imdb_handler { nick uhost hand chan args } {
        global DEBUG imdbVERSION imdburl imdbsearchurl b_agent
        global show_rating show_genre show_tagline show_outline show_cast
        global pub_or_not

   # How do you want your results ? chan or priv
        if {$pub_or_not == 1 } {
        set toput "PRIVMSG $chan"
        } else {
        set toput "NOTICE $nick"
        }

          # set to defaults
                set o_rating $show_rating
                set o_genre $show_genre
                set o_tagline $show_tagline
                set o_outline $show_outline
                set o_cast $show_cast


                set checkargs [string trim $args " \n"]

                # if no arguments passed, show help
                if {[string compare $checkargs "{}"] == 0} {
                        putserv "NOTICE $nick :^BIMDb info script v$imdbVERSION^B - ^C7General Help^C"
                        putserv "NOTICE $nick :^C14<===========================================>^C"
                        putserv "NOTICE $nick :^C7!imdb \[options\] <imdb title>"
                        putserv "NOTICE $nick :^C7options: -r     ratings"
                        putserv "NOTICE $nick :^C7         -g     genre"
                        putserv "NOTICE $nick :^C7         -t     tagline"
                        putserv "NOTICE $nick :^C7         -o     plot outline"
                        putserv "NOTICE $nick :^C7         -c     cast"
                        putserv "NOTICE $nick :^C7Example: !imdb -o -c Beautiful Mind"
                        return
                }

        # Look for command line options and enable each, as desired
        set fargs ""
                set imdbtitle ""
                foreach piece [split $args " "] {
                        set piece       [string trim $piece "{}"]
                                if {[string compare $piece "-r"] == 0 } {
                                        set o_rating 1
                                } elseif {[string compare $piece "-g"] == 0 } {
                                        set o_genre 1
                                } elseif {[string compare $piece "-t"] == 0 } {
                                        set o_tagline 1
                                } elseif {[string compare $piece "-o"] == 0 } {
                                        set o_outline 1
                                } elseif {[string compare $piece "-c"] == 0 } {
                                        set o_cast 1
                                } else {
                                        set fargs "$fargs $piece"
                                }
                }
        #set fargs [string trimleft $args]
        if {$DEBUG == 1} {
                putserv "NOTICE $nick :I am doing a search for "$fargs" on imdb.com"
        }

        set query $fargs

                # do initial search
                set searchString [ ::http::formatQuery $query ]
                set searchString [string trimleft $searchString "+"]
                if {$DEBUG == 1} {
                 putserv "NOTICE $nick :searchString: "$searchString""
                }
                set page [::http::config -useragent $b_agent]
                set page [::http::geturl ${imdbsearchurl}q=${searchString}&sort=smart&tv=off]

                set redirect 0
                set newurl ""

                set lines [split [::http::data $page] \n]
                set numLines [llength $lines]

                for {set i 0} {$i < $numLines} {incr i 1} {
                        set line [lindex $lines $i]
                                #if redirect necessary, find first link and redirect
                                #putserv "NOTICE $nick : $line"
                                if {[string match "*title search*" $line]} {
                                        set redirect 1
                                        #putserv "NOTICE $nick : redirect 1"
                                                for {} {$i < $numLines} {incr i 1} {
                                                        set line [lindex $lines $i]
                                                                if {[string match -nocase "*1. *" $line]} {
                                                                        regexp href="\[^"\]*" $line title
                                                                                set title [string range $title 6 [expr [string length $title] - 2]]
                                                                                append newurl $imdburl $title

                                                                                # get the page redirected to
                                                                                set page [::http::config -useragent $b_agent]
                                                                                set page [::http::geturl ${newurl}]
                                                                                set lines [split [::http::data $page] \n]
                                                                }
                                                }
                                        set i $numLines
                                }
                }

        # if no redirect happened, then get first page on match

        if {$redirect == 0} {
                upvar 0 $page oldpage
                        regexp Location\ \[^\ \]*\ Connection $oldpage(meta) location
                        #putserv "NOTICE $nick : $oldpage(meta)"
                        set newurl [string range $location 9 [expr [string length $location] - 12]]
                        set page [::http::config -useragent $b_agent]
                        set page [::http::geturl ${newurl}]
                        set lines [split [::http::data $page] \n]
        }

        # for bogus searches
        if {[string length $newurl] == 0} {
                putserv "NOTICE $nick :No no no! I can't find that!"
                        return
        }

        set numLines [llength $lines]

        # scan for wanted data from the page
                for {set i 0} {$i < $numLines} {incr i 1} {
                        set line [lindex $lines $i]
                                if {[string compare -length 7 $line "<title>"] == 0} {
                                        # the movie title, year, url
                                        set title [string range $line 7 [expr [string length $line] - 9]]
                                                set title [string map {ß ß ä ä ö ö ü ü Ä Ä Ö Ö Ü Ü è č  é é ê ę á á à ŕ } $title]
                                                putserv "$toput :^B$title^B \( $newurl \)"
                                } elseif {($o_tagline == 1) && ([regexp \[.\]*Tagline:\[.\]* $line] > 0)} {
                                        # the tagline
                                        regsub -all \<\[^\>\]*\> $line "" tagline
                                                regsub -all \\\(\[^\\\)\]*\\\) $tagline "" tagline
                                                regsub -all \[\ \t\]+ $tagline " " tagline
                                                regsub -all \&nbsp\; $tagline " " tagline
                                                set tagline [string trim $tagline " "]
                                                set tagline [string map {ß ß ä ä ö ö ü ü Ä Ä Ö Ö Ü Ü è č  é é ê ę á á à ŕ } $tagline]
                                                putserv "$toput :$tagline"
                                } elseif {($o_outline == 1) && ([regexp \[.\]*Outline:\[.\]* $line] > 0)} {
                                        # the outline
                                        regsub -all \<\[^\>\]*\> $line "" outline
                                                regsub -all \\\(\[^\\\)\]*\\\) $outline "" outline
                                                regsub -all \[\ \t\]+ $outline " " outline
                                                regsub -all \&nbsp\; $outline " " outline
                                                set outline [string trim $outline " "]
                                                set outline [string map {ß ß ä ä ö ö ü ü Ä Ä Ö Ö Ü Ü è č  é é ê ę á á à ŕ } $outline]
                                                putserv "NOTICE $nick :$outline"
                                } elseif {($o_genre == 1) && ([regexp \[.\]*Genres\[.\]* $line] > 0)} {
                                        # the genre
                                        regsub -all \<\[^\>\]*\> $line "" genre
                                                regsub -all \\\(\[^\\\)\]*\\\) $genre "" genre
                                                regsub -all \[\ \t\]+ $genre " " genre
                                                set genre [string trim $genre " "]
                                                set genre "Genre: $genre"
                                                putserv "$toput :$genre"
                                } elseif {($o_rating == 1) && ([regexp \[.\]*User\ Rating\[.\]* $line] > 0)} {
                                        # the user rating
                                        set j [expr $i + 3]
                                        set line2 [lindex $lines $j]
                                        set j [expr $i + 4]
                                        set line3 [lindex $lines $j]
                                        regsub -all \<\[^\>\]*\> $line3 "" rating
                                                regsub -all \&nbsp\; $rating " " rating
                                                regsub -all \[\ \t\]+ $rating " " rating
                                                set rating [string trim $rating " "]
                                                set goldstars [regexp -all goldstar $line2]
                                                set greystars [expr 10 - $goldstars]

                                                # generating the rating bar
                                                set marker "*"
                                                set rating_bar "^C11\[^C7"
                                                for {set i2 0} {$i2 < $goldstars} {incr i2 1} {
                                                        set rating_bar "$rating_bar$marker"
                                                }
                                        set marker "-"
                                                set rating_bar "$rating_bar^C14"
                                                for {set i3 0} {$i3 < $greystars} {incr i3 1} {
                                                        set rating_bar "$rating_bar$marker"
                                                }
                                        set rating_bar "$rating_bar^C11\]^C"
                                                putserv "$toput :$rating $rating_bar"
                                } elseif {($o_cast == 1) && ([regexp \[.\]*\\\.\\\.\\\.\\\.\[.\]* $line] > 0)} {

                                        if {[regexp Name $line] > 0} {
                                                regsub -all \<\[^\>\]*\> $line "" cast
                                                set cast [string map {ß ß ä ä ö ö ü ü Ä Ä Ö Ö Ü Ü è č  é é ê ę á á à ŕ } $cast]
                                                set checkargs [string trim $args " \n"]
                                                        putserv "NOTICE $nick :$cast"
                                        }
                                }
                }

}

User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

dangerko wrote:.set errorInfo doesn't works for me..
# Comment these two lines if you wish to enable the .tcl and .set commands.
# If you select your owners wisely, you should be okay enabling these.
unbind dcc n tcl *dcc:tcl
unbind dcc n set *dcc:set
Make your changes and simply .rehash your bot; the command demond mentioned will become available.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

2 likely reasons for this (naively and poorly implemented) script to fail with the (partial) error msg you provided:
  • you haven't set correctly global variable imdbsearchurl
  • search criteria are invalid (less likely to cause unsupported URL type)
d
dangerko
Voice
Posts: 6
Joined: Wed Jan 05, 2005 5:24 pm

Post by dangerko »

Alchera wrote:
dangerko wrote:.set errorInfo doesn't works for me..
# Comment these two lines if you wish to enable the .tcl and .set commands.
# If you select your owners wisely, you should be okay enabling these.
unbind dcc n tcl *dcc:tcl
unbind dcc n set *dcc:set
Make your changes and simply .rehash your bot; the command demond mentioned will become available.
i made:

#unbind dcc n tcl *dcc:tcl
#unbind dcc n set *dcc:set

the command is still unavailible for me...
d
dangerko
Voice
Posts: 6
Joined: Wed Jan 05, 2005 5:24 pm

Post by dangerko »

demond wrote:2 likely reasons for this (naively and poorly implemented) script to fail with the (partial) error msg you provided:
  • you haven't set correctly global variable imdbsearchurl
  • search criteria are invalid (less likely to cause unsupported URL type)
i have found out, that when i use for example:

!imdb hello there
bot will notice me with mesg: No no no! I can't find that!
without PL error

!imdb garden state
returns error to PL: [15:35] Tcl error [imdb_handler]: Unsupported URL type "{http" with no notice on IRC..

i have

set imdbsearchurl "http://www.imdb.com:80/find?" and this should works i think...
d
dangerko
Voice
Posts: 6
Joined: Wed Jan 05, 2005 5:24 pm

Post by dangerko »

i have updated to eggdrop v1.6.18+update_copyright but it's still the same...
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

try using the options that show up when you type !imdb without arguments
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

Use this script that i have uploaded to my webserver i know this one works as i use it myself.

Hope this helps :wink:

Edit: Script removed from server
Last edited by ^DooM^ on Wed Jan 19, 2005 7:45 pm, edited 1 time in total.
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
d
dangerko
Voice
Posts: 6
Joined: Wed Jan 05, 2005 5:24 pm

Post by dangerko »

^DooM^ wrote:Use this script that i have uploaded to my webserver i know this one works as i use it myself.

Click Me

Hope this helps :wink:
this one works, thank you ;-)
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

Your Welcome I shall remove that script from my server now. :wink:
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
s
shadow20
Voice
Posts: 2
Joined: Tue Jan 11, 2005 2:54 pm

"No no no! I can't find that!"

Post by shadow20 »

I've got error with 'set DEBUG 1' at the imdb.tcl

[03:56] <Electric> !imdb -o -c Beautiful Mind
[03:56] -Guest4321702- I am doing a search for " Beautiful Mind" on imdb.com
[03:56] -Guest4321702- searchString: "Beautiful+Mind"
[03:56] -Guest4321702- No no no! I can't find that!

Why bot everytime written this message?
j
jimbo
Voice
Posts: 3
Joined: Wed Jan 19, 2005 6:53 pm

Post by jimbo »

^DooM^ wrote:Use this script that i have uploaded to my webserver i know this one works as i use it myself.

Click Me

Hope this helps :wink:
can you uploaded 1 more time for me to grab my friend :)
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

Please no more requests for this script if you want the latest one Its at the ioftpd website.
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
Locked