Xcaliber Power Guide..!!
ioFTPD
ioFTPD Korea Docs
ioFTPD Korea Docs Forum
 
Total Commander
토탈 커맨더 - 한국 유저 포럼
 
FTP
FTP는 File Transfer Protocol(파일 전송 프로토콜)의 약자로 서로 떨어져 있는 컴퓨터 끼리 파일을 주고 받기 위한 통신 상의 규약을 말합니다.
FTP 강좌에서는 FTP의 고급활용에 대해 다룹니다.
IRC
IRC란 Internet Relay Chat의 약자로 여러분은 IRC를 통하여 전세계 사람들과 실시간으로 이야기를 나눌 수 있습니다.
IRC 강좌에서는 Bouncer사용법등 고급활용에 대해 다룹니다..
Eggdrop
여러 언어로 개발되어 사용되고 있는 IRC bot중 Eggdrop은 1993년 GNU General Public License (GPL)를 따르는 Open Source Project로 개발 되었으며, Eggdrop은 IRC Client/bot으로서의 기능을 모두 갖추고 있기 때문에 사용자가 원하는 기능을 Tcl언어등으로 된 Plugin을 추가하는 것만으로 쉽게 IRC bot을 제작할 수 있어 가장 널리 사용되고 있는 강력한 bot입니다. Eggdrop 강좌에서는 Tcl언어로 된 플러긴을 이용한 IRC bot의 활용과 채널의 유지/관리를 다룹니다.
Home > Q & A :: freeboard :: GuestBook ::

View Article     
Name
  이유진 2003-07-25 22:19:11, Hit : 6851
Subject   IMDb 이거좀 가르쳐주세요.
자주 질문 드려서 죄송합니다.._(_ _)_
!imdb ****
하면요 저혼자만 서치내용이 보이거던요.
누구든지 서치하면 irc방의 모든사람들이 볼수있게
할려면 어떻게해요?
그럼 수고하세요...

#########################################################################
# Chilla's IMDb info script
#
##
# Notes for this version: Thanks to 2dee for showing me his
# imdb site update fix. Thanks to TotaLGaZ for his help.
# Thanks to Chilla and FAN for their work on this brilliant script.
# Would like to make the options selectable from the partyline and also
# add a disable trigger in channel(both specific and global) option. Who
# knows might get round to it one day but if anyone else wants to then it
# will save me a job.
##
#
# Version: 20030014 - works with updated imdb site, new option of public
# or notice response to chan triggers.
# - GQsm http://forum.egghelp.org
##
# Version: 20020604 - fixed misc http/html stuff, added msg command - FAN
##
# Version: 20011031 - - Chilla
#########################################################################

# base imdb url, to which you can append "/Title?######" or whatever
set imdburl "http://www.imdb.com"

# the imdb search script
set imdbsearchurl "http://imdb.com:80/Tsearch?"

# 1 for each of these means that the respective values will ALWAYS show
# and that command options for these will be disregarded
# leave zero to keep them an option at the command line
set show_rating 1
set show_genre 1
set show_tagline 1
set show_outline 0
set show_cast 0

# for a channel !imdb request
# set to 1 = title ,rating, genre and tagline(if selected) will be displayed
# publicly to the channel
# set to 0 = all results will be sent as private notice
set pub_or_not 0

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

set DEBUG 0
set imdbVERSION 20030014
set b_agent "MSIE 6.0"

# If you are getting http error messages, try uncommentign this next line:
#package forget http
package require http 2.3

bind pub -|- !imdb imdb_handler
bind msg -|- !imdb imdb_msghandler

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 :IMDb info script v$imdbVERSION - 7General Help"
                        putserv "NOTICE $nick :14<===========================================>"
                        putserv "NOTICE $nick :7!imdb \[options\] <imdb title>"
                        putserv "NOTICE $nick :7options: -r     ratings"
                        putserv "NOTICE $nick :7         -g     genre"
                        putserv "NOTICE $nick :7         -t     tagline"
                        putserv "NOTICE $nick :7         -o     plot outline"
                        putserv "NOTICE $nick :7         -c     cast"
                        putserv "NOTICE $nick :7Example: !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}title=${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 compare $line "<TITLE>IMDb title search</TITLE>"] == 0} {
                                        set redirect 1
                                        #putserv "NOTICE $nick : redirect 1"
                                                for {} {$i < $numLines} {incr i 1} {
                                                        set line [lindex $lines $i]
                                                                if {[string compare -length 8 $line "<OL><LI>"] == 0} {
                                                                        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 :$title \( $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 \ \; $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 \ \; $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 \ \; $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 "11\[7"
                                                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_bar11\]"
                                                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"
                                        }
                                }
                }

}

proc imdb_msghandler { nick uhost hand args } {
        global DEBUG imdbVERSION imdburl imdbsearchurl b_agent
        global show_rating show_genre show_tagline show_outline show_cast

          # 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 "PRIVMSG $nick :IMDb info script v$imdbVERSION - 7General Help"
                        putserv "PRIVMSG $nick :14<===========================================>"
                        putserv "PRIVMSG $nick :7!imdb \[options\] <imdb title>"
                        putserv "PRIVMSG $nick :7options: -r     ratings"
                        putserv "PRIVMSG $nick :7         -g     genre"
                        putserv "PRIVMSG $nick :7         -t     tagline"
                        putserv "PRIVMSG $nick :7         -o     plot outline"
                        putserv "PRIVMSG $nick :7         -c     cast"
                        putserv "PRIVMSG $nick :7Example: !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 "PRIVMSG $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 "PRIVMSG $nick :searchString: \"$searchString\""                
                }
                set page [::http::config -useragent $b_agent]
                set page [::http::geturl ${imdbsearchurl}title=${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 "PRIVMSG $nick : $line"
                                if {[string compare $line "<TITLE>IMDb title search</TITLE>"] == 0} {
                                        set redirect 1
                                        #putserv "PRIVMSG $nick : redirect 1"
                                                for {} {$i < $numLines} {incr i 1} {
                                                        set line [lindex $lines $i]
                                                                if {[string compare -length 8 $line "<OL><LI>"] == 0} {
                                                                        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 "PRIVMSG $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 "PRIVMSG $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]
                   


(2003-07-27 18:29:11)  
set pub_or_not 0
이부분을 1로 하시면 됩니다.

set pub_or_not 1


No
Subject
Name
Date
Hit
notice   ioFTPD에 관한 질문은 포럼을 이용해 주... 2002/07/16  3889
174    EggDrop 사용 관련 입니다./ 김도진 2007/08/12  4945
173    windrop에서 excess flood문제 [3] goldra 2003/11/06  4219
172    tcl 스크립 질문입니다. [2] 칼잡이발도제 2003/11/02  3977
171    Windrop 관련 질문입니다. [2] 무늬 2003/10/21  4167
170    다중채널에 어나운싱에 관해서 [1] 김기동 2003/10/12  3893
169    질문입니다... [4] 칼잡이발도제 2003/10/10  3942
168    엑스칼리버님 죄송해요.. 아직도 오토옵을 ... [4] 박동민 2003/09/30  4192
167    밴리스트가 자꾸 지워집니다. [1] 케비에 2003/09/13  3905
166    tcl스크립트가 에러가나는데 무었때문인지.... [4] 배우자 2003/09/06  4461
165    eggdrop과 ftp 연동은 잘 된거같은데... [4] 배우자 2003/09/06  3727
164    봇이 채널에 조인을 안합니다. [1] 리아 2003/08/20  3867
163    또 질문드려서 죄송합니다. 잘 몰라서 다시... [1] 리아 2003/08/19  3727
162    에그드랍 1개로 여러채널 어나운스가 안됩... [1] 리아 2003/08/18  4095
161    밑에 챈옵 안되는;; [1] 박동민 2003/08/15  3763
160    bw/uploaders와 같은 트리거가 제대... [1] 트리거 2003/08/14  4126
159    봇탱이를 닉등록하고 닉인증까지 시켰는데;; ... [1] 박동민 2003/08/11  4625
158    또하나 질문 드립니다^^;; [1] 무늬 2003/08/07  4078
157    DEKUF 에 대하여 질문드립니다. [1] 무늬 2003/08/05  4151
156    업완료후 마지막 2줄 어나운싱이 안됩니다.... [1] Now 2003/08/04  3828
   IMDb 이거좀 가르쳐주세요. [1] 이유진 2003/07/25  6851
154    어나운스 한글.. [1] spike 2003/07/25  4022
153    Announce 도움요청요.. [4] 이유진 2003/07/24  4176
1 [2][3][4][5][6][7][8] Next
Copyright 1999-2017 Zeroboard / skin by lifesay
: help subject/ name/ content
Xcaliber Power Guide ⓒ 2002-2012 Xcaliber™ All right reserved