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.

imdbapi.com v1

Support & discussion of released scripts, and announcements of new releases.
d
doggo
Halfop
Posts: 97
Joined: Tue Jan 05, 2010 7:53 am
Contact:

imdbapi.com v1

Post by doggo »

Hi all, im still fairly noob at tcl.. but ive been working on this script that makes use the api @ http://imdbapi.com

I have been testing it for about a week now making sure it all works ok :) and wanted to share it with you guys :D

what it looks like http://i.imgur.com/zuMww.png

All you should need do is load the script and edit these 3 variables and ue the help trigger..

Code: Select all

??imdb

[06:44pm] <doggo> ??imdb
[06:44pm] <spunky> [IMDB Search Help]
[06:44pm] <spunky> [Search IMDB Id] -tt tt0234215 | or | -tt tt0234215 switch
[06:44pm] <spunky> [Search Titles] -imdb the matrix reloaded | or | -imdb the matrix reloaded --switch
[06:44pm] <spunky> [Search Switches] title year rated released genre director writer cast plot poster runtime rating votes link | no switch = spam :D
and have yr bot explain it :P

Code: Select all

#trigger to search by ttid  
variable info_tttrig "-tt"

#title search trigger
variable info_strig "-imdb"

#channel to work in
variable imdb_channel "#omgwtfnzbs"

Here it is

Code: Select all

# 04/04/2012
# by doggo #omgwtfnzbs @ EFNET
# drop in and try this script ;) all feedback is welcome

namespace eval imdb  {
namespace eval api {

#time limit between cmds
variable flood_set "10"

#trigger to search by ttid  
variable info_tttrig "-tt"

#title search trigger
variable info_strig "-imdb"

#channel to work in
variable imdb_channel "#omgwtfnzbs"


variable ttsearch_url "http://www.imdbapi.com/?i"
variable titlesearch_url "http://www.imdbapi.com/?t"
variable pub "PRIVMSG $imdb::api::imdb_channel"
variable info_htrig "??imdb"

}

bind pub -|- $imdb::api::info_tttrig imdb::imdb_evaluate::evaluate_imdb
bind pub -|- $imdb::api::info_strig imdb::imdb_evaluate_search::search_evaluate_imdb
bind pub -|- $imdb::api::info_htrig imdb::imdb_helper::helper_imdb


# get info from ttid proc
namespace eval imdb_evaluate {
proc evaluate_imdb {nick hand host chan titleid} {

#flood protection, borrowed from http://forum.egghelp.org/viewtopic.php?t=17078 :D

variable imdb_flood

if {[info exists imdb_flood(lasttime,$chan)] && [expr $imdb_flood(lasttime,$chan) + $imdb::api::flood_set] > [clock seconds]} {
   puthelp "$imdb::api::pub :You can use only 1 command in $imdb::api::flood_set seconds. Wait [expr $imdb::api::flood_set - [expr [clock seconds] - $imdb_flood(lasttime,$chan)]] seconds and try again.";return
}

set titleid [stripcodes bcruag $titleid]
set ttid [lindex [split $titleid] 0]
set action ""
set action [lindex [split $titleid] 1]

if {$ttid==""} {putquick "$imdb::api::pub :Usage: $imdb::api::info_ttrig tt1899353";return}
if {![regexp {^tt([0-9]+)$} $ttid match imdbid] } {putquick "$imdb::api::pub :Error: not a valid ttid";return}

catch {set http [::http::geturl $imdb::api::ttsearch_url=tt$imdbid -timeout 15000]} error
set information [::http::data $http]
::http::cleanup $http
regexp -nocase {response\"\:\"(.*?)\"} $information match response

if {![info exists response]} {putquick "$imdb::api::pub :$imdb::api::ttsearch_url=tt$imdbid timed out.. try again in a bit ";return}
if {![string match "True" $response]} {putquick "$imdb::api::pub :Error: Unknown IMDb ID";return}

::imdb::imdb_trigger::trigger_imdb $information $action

set imdb_flood(lasttime,$chan) [clock seconds]
  }
}


# get info from title search proc
namespace eval imdb_evaluate_search {
proc search_evaluate_imdb {nick hand host chan search_text} {

#flood protection, borrowed from http://forum.egghelp.org/viewtopic.php?t=17078 :D

variable imdb_flood

if {[info exists imdb_flood(lasttime,$chan)] && [expr $imdb_flood(lasttime,$chan) + $imdb::api::flood_set] > [clock seconds]} {
   puthelp "$imdb::api::pub :You can use only 1 command in $imdb::api::flood_set seconds. Wait [expr $imdb::api::flood_set - [expr [clock seconds] - $imdb_flood(lasttime,$chan)]] seconds and try again.";return
}

set search_term [stripcodes bcruag $search_text]
set do_search [lrange [split $search_term] 0 end]
set imdbswitch ""

if {$do_search==""} {putquick "$imdb::api::pub :Usage: $imdb::api::info_strig Mission Impossible";return}

if {[regexp -nocase {^([a-z0-9\s]+)\s\-\-([a-z]+)$} $do_search match imdbsearch imdbswitch]} {

catch {set http [::http::geturl $imdb::api::titlesearch_url=[string map { " " "+" } $imdbsearch] -timeout 15000]} error
set information [::http::data $http]
::http::cleanup $http

regexp -nocase {response\"\:\"(.*?)\"} $information match response

if {![info exists response]} {putquick "$imdb::api::pub :Error: $imdb::api::titlesearch_url=[string map { " " "+" } $imdbsearch] timed out.. try again in a bit ";return}
if {![string match "True" $response]} {putquick "$imdb::api::pub :Error: 0 Results for $imdbsearch";return}

::imdb::imdb_trigger::trigger_imdb $information $imdbswitch

} elseif {[regexp {^([a-z0-9\s]+)$} $do_search match imdbsearch]} {

catch {set http [::http::geturl $imdb::api::titlesearch_url=[string map { " " "+" } $imdbsearch] -timeout 15000]} error
set information [::http::data $http]
::http::cleanup $http

regexp -nocase {response\"\:\"(.*?)\"} $information match response

if {![info exists response]} {putquick "$imdb::api::pub :Error: $imdb::api::titlesearch_url=[string map { " " "+" } $imdbsearch] timed out.. try again in a bit ";return}
if {![string match "True" $response]} {putquick "$imdb::api::pub :Error: 0 Results for $imdbsearch";return}

::imdb::imdb_trigger::trigger_imdb $information $imdbswitch

} else {

putquick "$imdb::api::pub :Error: bad input";return

}

set imdb_flood(lasttime,$chan) [clock seconds]
  }
}


# parse the returned jason proc
namespace eval imdb_trigger {
proc trigger_imdb {api_response type} {

set information [lindex $api_response 0]
set action [lindex $type 0]

regexp -nocase {title\"\:\"(.*?)\"} $information match title
regexp -nocase {year\"\:\"(.*?)\"} $information match year
regexp -nocase {rated\"\:\"(.*?)\"} $information match rated
regexp -nocase {released\"\:\"(.*?)\"} $information match released
regexp -nocase {genre\"\:\"(.*?)\"} $information match genre
regexp -nocase {director\"\:\"(.*?)\"} $information match director
regexp -nocase {writer\"\:\"(.*?)\"} $information match writer
regexp -nocase {actors\"\:\"(.*?)\"} $information match actors
regexp -nocase {plot\"\:\"(.*?)\"} $information match plot
regexp -nocase {poster\"\:\"(.*?)\"} $information match poster
regexp -nocase {runtime\"\:\"(.*?)\"} $information match runtime
regexp -nocase {rating\"\:\"(.*?)\"} $information match rating
regexp -nocase {votes\"\:\"(.*?)\"} $information match votes
regexp -nocase {ID\"\:\"(.*?)\"} $information match id

switch -exact -- [string tolower $action] {

"title" {
        putquick "$imdb::api::pub :\00308\[IMDB Title\]\017 $title"
}

"year" {
        putquick "$imdb::api::pub :\00308\[IMDB Year\]\017 $year"
}

"rated" {
        putquick "$imdb::api::pub :\00308\[IMDB Rated\]\017 $rated"
}

"released" {
        putquick "$imdb::api::pub :\00308\[IMDB Released\]\017 $released"
}

"genre" {
        putquick "$imdb::api::pub :\00308\[IMDB Genre\]\017 $genre"
}

"director" {
        putquick "$imdb::api::pub :\00308\[IMDB Directed By\]\017 $director"
}

"writer" {
        putquick "$imdb::api::pub :\00308\[IMDB Written By\]\017 $writer"
}

"cast" {
        putquick "$imdb::api::pub :\00308\[IMDB Cast\]\017 $actors"
}

"plot" {
        putquick "$imdb::api::pub :\00308\[IMDB Plot\]\017 $plot"
}

"poster" {
        putquick "$imdb::api::pub :\00308\[IMDB Poster\]\017 $poster"
}

"runtime" {
        putquick "$imdb::api::pub :\00308\[IMDB Runtime\]\017 $runtime"
}

"rating" {
        putquick "$imdb::api::pub :\00308\[IMDB Rating\]\017 $rating"
}

"votes" {
        putquick "$imdb::api::pub :\00308\[IMDB Votes\]\017 $votes"
}

"link" {
        putquick "$imdb::api::pub :\00308\[Link\]\017 http://www.imdb.com/title/$id/"
}
default { 
        putquick "$imdb::api::pub :\00308\[Title\]\017 $title \00308\[Year\]\017 $year \00308\[Genre\]\017 $genre" 
        putquick "$imdb::api::pub :\00308\[Directed By\]\017 $director \00308\[Writen By\]\017 $writer" 
        putquick "$imdb::api::pub :\00308\[Released\]\017 $released \00308\[Rated\]\017 $rated" 
        putquick "$imdb::api::pub :\00308\[Cast\]\017 $actors" 
        putquick "$imdb::api::pub :\00308\[Plot\]\017 $plot" 
        putquick "$imdb::api::pub :\00308\[Poster\]\017 $poster" 
        putquick "$imdb::api::pub :\00308\[Runtime\]\017 $runtime \00308\[Rating\]\017 $rating \00308\[Votes\]\017 $votes" 
        putquick "$imdb::api::pub :\00308\[Link\]\017 http://www.imdb.com/title/$id/" 
      } 
    }
  }
}


# usage helper proc
namespace eval imdb_helper {
proc helper_imdb {nick hand host chan text} {

        putquick "$imdb::api::pub :\00308\[IMDB Search Help\]\017"
        putquick "$imdb::api::pub :\00308\[Search IMDB Id\]\017 $imdb::api::info_tttrig tt0234215 | or | $imdb::api::info_tttrig tt0234215 switch"
        putquick "$imdb::api::pub :\00308\[Search Titles\]\017 $imdb::api::info_strig the matrix reloaded | or | $imdb::api::info_strig the matrix reloaded --switch"
        putquick "$imdb::api::pub :\00308\[Search Switches\]\017 title year rated released genre director writer cast plot poster runtime rating votes link | no switch = spam :D"

  }
}


#//end all 
}
Feedback welcomed :) like i said im still a bit of a noob @ tcl scripting
Last edited by doggo on Sat Jun 02, 2012 9:57 am, edited 2 times in total.
n
nabbelol
Voice
Posts: 4
Joined: Thu Jan 12, 2012 2:22 pm

Post by nabbelol »

Very nice script! works very well, easy to read and modify.

I would recommend you to make the color into a variable so its easier to change it :)

Also I changed the id to URL, since I see no use in just the ID, better with a click-able URL :)

I personally like more information on one line, so I changed the script to my liking.
g
goalie204
Halfop
Posts: 44
Joined: Thu Apr 28, 2011 7:31 pm

Post by goalie204 »

post plz, need a working imdb script

tried as posted and

-imdb the matrix
.[secksy(dcc)] [11:46] Tcl error [imdb::imdb_evaluate_search::search_evaluate_imdb]: can't read "http": no such variable

http.tcl is loaded first
d
doggo
Halfop
Posts: 97
Joined: Tue Jan 05, 2010 7:53 am
Contact:

Post by doggo »

this is a working script ;) using this http tcl with it no probs http://pastebin.com/nQCgBBWf

what http script were you using?
g
goalie204
Halfop
Posts: 44
Joined: Thu Apr 28, 2011 7:31 pm

Post by goalie204 »

thanks putting that egghttp tcl worked and now it works

how can i change the imdb id to the url of the movie info, and how can i consolodate it a bit so its less spammy
thanks
d
doggo
Halfop
Posts: 97
Joined: Tue Jan 05, 2010 7:53 am
Contact:

Post by doggo »

take a look at this part of the code

Code: Select all


default { 
        putquick "$imdb::api::pub :\00308\[Title\]\017 $title \00308\[Year\]\017 $year \00308\[Genre\]\017 $genre" 
        putquick "$imdb::api::pub :\00308\[Directed By\]\017 $director \00308\[Writen By\]\017 $writer" 
        putquick "$imdb::api::pub :\00308\[Rated\]\017 $rated" 
        putquick "$imdb::api::pub :\00308\[Released\]\017 $released" 
        putquick "$imdb::api::pub :\00308\[Cast\]\017 $actors" 
        putquick "$imdb::api::pub :\00308\[Plot\]\017 $plot" 
        putquick "$imdb::api::pub :\00308\[Poster\]\017 $poster" 
        putquick "$imdb::api::pub :\00308\[Runtime\]\017 $runtime" 
        putquick "$imdb::api::pub :\00308\[Rating\]\017 $rating" 
        putquick "$imdb::api::pub :\00308\[Votes\]\017 $votes" 
        putquick "$imdb::api::pub :\00308\[IMDB Id\]\017 $id" 
      }

and change it to this, ive tried to make it a bit less spammy :P

Code: Select all


default { 
        putquick "$imdb::api::pub :\00308\[Title\]\017 $title \00308\[Year\]\017 $year \00308\[Genre\]\017 $genre" 
        putquick "$imdb::api::pub :\00308\[Directed By\]\017 $director \00308\[Writen By\]\017 $writer" 
        putquick "$imdb::api::pub :\00308\[Released\]\017 $released \00308\[Rated\]\017 $rated" 
        putquick "$imdb::api::pub :\00308\[Cast\]\017 $actors" 
        putquick "$imdb::api::pub :\00308\[Plot\]\017 $plot" 
        putquick "$imdb::api::pub :\00308\[Poster\]\017 $poster" 
        putquick "$imdb::api::pub :\00308\[Runtime\]\017 $runtime \00308\[Rating\]\017 $rating \00308\[Votes\]\017 $votes" 
        putquick "$imdb::api::pub :\00308\[Link\]\017 http://www.imdb.com/title/$id/" 
      } 
also replaced [IMDB Id] with the weblink to imdbs info page :)

edited first post to reflect the changes
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Why don't you use puthelp instead of putquick? Doesn't the bot flood itself off? :)
Once the game is over, the king and the pawn go back in the same box.
d
doggo
Halfop
Posts: 97
Joined: Tue Jan 05, 2010 7:53 am
Contact:

Post by doggo »

i used puthelp in testing, and the default output was slow to be announced in channel.. i know putquick is used more for sending messages to the sever rather than a channel or user but it did what i wanted without the bot flooding its self off..

made me think though.. (*dangerous*) there is no flood protection added in the script so potentially users could flood the bot off by searching to fast, ill look into adding some.. ive not had any problems using this script with putquick in place of puthelp though :)


*Edit*

Added some flood protection, made changes to first post :)
x
x0x
Op
Posts: 140
Joined: Tue Feb 10, 2009 6:42 am

Post by x0x »

http://www.imdbapi.com changed to http://www.omdbapi.com so you need to update that to get the script to work.

Found something strange tho. When using capital letters: Error: bad input

!imdb The Matrix
Error: bad input

!imb the matrix
Works
l
liljim
Voice
Posts: 12
Joined: Tue Dec 11, 2007 6:51 pm

Post by liljim »

Could someone modify this so it can be used in multiple channels? Perhaps by setting +imdb or +omdb? That would be really great.
x
x0x
Op
Posts: 140
Joined: Tue Feb 10, 2009 6:42 am

Post by x0x »

Besides this missing functionality, does the script work for you? Because when I use capital letters, an error occurs.
l
liljim
Voice
Posts: 12
Joined: Tue Dec 11, 2007 6:51 pm

Post by liljim »

x0x wrote:Besides this missing functionality, does the script work for you? Because when I use capital letters, an error occurs.
I don't know if there's a more elegant way, but changing

Code: Select all

} elseif {[regexp {^([a-z0-9\s]+)$} $do_search match imdbsearch]} { 
to

Code: Select all

} elseif {[regexp {^([a-z0-9A-Z\s]+)$} $do_search match imdbsearch]} {
works for me.
x
x0x
Op
Posts: 140
Joined: Tue Feb 10, 2009 6:42 am

Post by x0x »

Indeed! NICE! Thank you :D
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

As for the "more elegant" version:

Code: Select all

} elseif {[regexp -nocase -- {^([[:alnum:]]+)$} $do_search match imdbsearch]} {
(-nocase for no case comparison, and bracket expression using character classes). liljim's suggestion is just as good though.
NML_375
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Fixed I hope

Post by SpiKe^^ »

liljim wrote:
Could someone modify this so it can be used in multiple channels? Perhaps by setting +imdb or +omdb? That would be really great.
Try this untested patch to the script.
# to add channels, do: .chanset #somechan +imdbapi

EDIT: This should be working now.

Code: Select all

# 04/04/2012 
# by doggo #omgwtfnzbs @ EFNET 
# drop in and try this script ;) all feedback is welcome 

# to add channels, do:  .chanset #somechan +imdbapi
setudef flag imdbapi

namespace eval imdb  { 
namespace eval api { 

#time limit between cmds 
variable flood_set "10" 

#trigger to search by ttid  
variable info_tttrig "-tt" 

#title search trigger 
variable info_strig "-imdb" 


variable ttsearch_url "http://www.omdbapi.com/?i" 
variable titlesearch_url "http://www.omdbapi.com/?t" 
variable info_htrig "??imdb" 

} 

bind pub -|- $imdb::api::info_tttrig imdb::imdb_evaluate::evaluate_imdb 
bind pub -|- $imdb::api::info_strig imdb::imdb_evaluate_search::search_evaluate_imdb 
bind pub -|- $imdb::api::info_htrig imdb::imdb_helper::helper_imdb 


# get info from ttid proc 
namespace eval imdb_evaluate { 
proc evaluate_imdb {nick hand host chan titleid} { 

  if {![channel get $chan "imdbapi"]} {  return 0  }

  set imdb_pub "PRIVMSG $chan"

#flood protection, borrowed from http://forum.egghelp.org/viewtopic.php?t=17078 :D 

variable imdb_flood 

if {[info exists imdb_flood(lasttime,$chan)] && [expr $imdb_flood(lasttime,$chan) + $imdb::api::flood_set] > [clock seconds]} { 
   puthelp "$imdb_pub :You can use only 1 command in $imdb::api::flood_set seconds. Wait [expr $imdb::api::flood_set - [expr [clock seconds] - $imdb_flood(lasttime,$chan)]] seconds and try again.";return 
} 

set titleid [stripcodes bcruag $titleid] 
set ttid [lindex [split $titleid] 0] 
set action "" 
set action [lindex [split $titleid] 1] 

if {$ttid==""} {putquick "$imdb_pub :Usage: $imdb::api::info_tttrig tt1899353";return} 
if {![regexp {^tt([0-9]+)$} $ttid match imdbid] } {putquick "$imdb_pub :Error: not a valid ttid";return} 

catch {set http [::http::geturl $imdb::api::ttsearch_url=tt$imdbid -timeout 15000]} error 
set information [::http::data $http] 
::http::cleanup $http 
regexp -nocase {response\"\:\"(.*?)\"} $information match response 

if {![info exists response]} {putquick "$imdb_pub :$imdb::api::ttsearch_url=tt$imdbid timed out.. try again in a bit ";return} 
if {![string match "True" $response]} {putquick "$imdb_pub :Error: Unknown IMDb ID";return} 

::imdb::imdb_trigger::trigger_imdb $information $action $chan

set imdb_flood(lasttime,$chan) [clock seconds] 
  } 
} 


# get info from title search proc 
namespace eval imdb_evaluate_search { 
proc search_evaluate_imdb {nick hand host chan search_text} { 

  if {![channel get $chan "imdbapi"]} {  return 0  }

  set imdb_pub "PRIVMSG $chan"

#flood protection, borrowed from http://forum.egghelp.org/viewtopic.php?t=17078 :D 

variable imdb_flood 

if {[info exists imdb_flood(lasttime,$chan)] && [expr $imdb_flood(lasttime,$chan) + $imdb::api::flood_set] > [clock seconds]} { 
   puthelp "$imdb_pub :You can use only 1 command in $imdb::api::flood_set seconds. Wait [expr $imdb::api::flood_set - [expr [clock seconds] - $imdb_flood(lasttime,$chan)]] seconds and try again.";return 
} 

set search_term [stripcodes bcruag $search_text] 
set do_search [lrange [split $search_term] 0 end] 
set imdbswitch "" 

if {$do_search==""} {putquick "$imdb_pub :Usage: $imdb::api::info_strig Mission Impossible";return} 

if {[regexp -nocase {^([a-z0-9\s]+)\s\-\-([a-z]+)$} $do_search match imdbsearch imdbswitch]} { 

catch {set http [::http::geturl $imdb::api::titlesearch_url=[string map { " " "+" } $imdbsearch] -timeout 15000]} error 
set information [::http::data $http] 
::http::cleanup $http 

regexp -nocase {response\"\:\"(.*?)\"} $information match response 

if {![info exists response]} {putquick "$imdb_pub :Error: $imdb::api::titlesearch_url=[string map { " " "+" } $imdbsearch] timed out.. try again in a bit ";return} 
if {![string match "True" $response]} {putquick "$imdb_pub :Error: 0 Results for $imdbsearch";return} 

::imdb::imdb_trigger::trigger_imdb $information $imdbswitch $chan

} elseif {[regexp {^([a-z0-9A-Z\s]+)$} $do_search match imdbsearch]} { 

catch {set http [::http::geturl $imdb::api::titlesearch_url=[string map { " " "+" } $imdbsearch] -timeout 15000]} error 
set information [::http::data $http] 
::http::cleanup $http 

regexp -nocase {response\"\:\"(.*?)\"} $information match response 

if {![info exists response]} {putquick "$imdb_pub :Error: $imdb::api::titlesearch_url=[string map { " " "+" } $imdbsearch] timed out.. try again in a bit ";return} 
if {![string match "True" $response]} {putquick "$imdb_pub :Error: 0 Results for $imdbsearch";return} 

::imdb::imdb_trigger::trigger_imdb $information $imdbswitch $chan

} else {  putquick "$imdb_pub :Error: bad input";return  } 

set imdb_flood(lasttime,$chan) [clock seconds] 
  } 
} 


# parse the returned jason proc 
namespace eval imdb_trigger { 
proc trigger_imdb {api_response type chan} { 

set information [lindex $api_response 0] 
set action [lindex $type 0] 

regexp -nocase {title\"\:\"(.*?)\"} $information match title 
regexp -nocase {year\"\:\"(.*?)\"} $information match year 
regexp -nocase {rated\"\:\"(.*?)\"} $information match rated 
regexp -nocase {released\"\:\"(.*?)\"} $information match released 
regexp -nocase {genre\"\:\"(.*?)\"} $information match genre 
regexp -nocase {director\"\:\"(.*?)\"} $information match director 
regexp -nocase {writer\"\:\"(.*?)\"} $information match writer 
regexp -nocase {actors\"\:\"(.*?)\"} $information match actors 
regexp -nocase {plot\"\:\"(.*?)\"} $information match plot 
regexp -nocase {poster\"\:\"(.*?)\"} $information match poster 
regexp -nocase {runtime\"\:\"(.*?)\"} $information match runtime 
regexp -nocase {rating\"\:\"(.*?)\"} $information match rating 
regexp -nocase {votes\"\:\"(.*?)\"} $information match votes 
regexp -nocase {ID\"\:\"(.*?)\"} $information match id 

set imdb_pub "PRIVMSG $chan"

switch -exact -- [string tolower $action] { 

"title" {  putquick "$imdb_pub :\00308\[IMDB Title\]\017 $title" } 

"year" {  putquick "$imdb_pub :\00308\[IMDB Year\]\017 $year" } 

"rated" {  putquick "$imdb_pub :\00308\[IMDB Rated\]\017 $rated" } 

"released" {  putquick "$imdb_pub :\00308\[IMDB Released\]\017 $released" } 

"genre" {  putquick "$imdb_pub :\00308\[IMDB Genre\]\017 $genre" } 

"director" {  putquick "$imdb_pub :\00308\[IMDB Directed By\]\017 $director" } 

"writer" {  putquick "$imdb_pub :\00308\[IMDB Written By\]\017 $writer" } 

"cast" {  putquick "$imdb_pub :\00308\[IMDB Cast\]\017 $actors" } 

"plot" {  putquick "$imdb_pub :\00308\[IMDB Plot\]\017 $plot" } 

"poster" {  putquick "$imdb_pub :\00308\[IMDB Poster\]\017 $poster" } 

"runtime" {  putquick "$imdb_pub :\00308\[IMDB Runtime\]\017 $runtime" } 

"rating" {  putquick "$imdb_pub :\00308\[IMDB Rating\]\017 $rating" } 

"votes" {  putquick "$imdb_pub :\00308\[IMDB Votes\]\017 $votes" } 

"link" {  putquick "$imdb_pub :\00308\[Link\]\017 http://www.imdb.com/title/$id/" } 

default { 
        putquick "$imdb_pub :\00308\[Title\]\017 $title \00308\[Year\]\017 $year \00308\[Genre\]\017 $genre" 
        putquick "$imdb_pub :\00308\[Directed By\]\017 $director \00308\[Writen By\]\017 $writer" 
        putquick "$imdb_pub :\00308\[Released\]\017 $released \00308\[Rated\]\017 $rated" 
        putquick "$imdb_pub :\00308\[Cast\]\017 $actors" 
        putquick "$imdb_pub :\00308\[Plot\]\017 $plot" 
        putquick "$imdb_pub :\00308\[Poster\]\017 $poster" 
        putquick "$imdb_pub :\00308\[Runtime\]\017 $runtime \00308\[Rating\]\017 $rating \00308\[Votes\]\017 $votes" 
        putquick "$imdb_pub :\00308\[Link\]\017 http://www.imdb.com/title/$id/" 
      } 
    } 
  } 
} 


# usage helper proc 
namespace eval imdb_helper { 
proc helper_imdb {nick hand host chan text} { 

        if {![channel get $chan "imdbapi"]} {  return 0  }

        set imdb_pub "PRIVMSG $chan"

        putquick "$imdb_pub :\00308\[IMDB Search Help\]\017" 
        putquick "$imdb_pub :\00308\[Search IMDB Id\]\017 $imdb::api::info_tttrig tt0234215 | or | $imdb::api::info_tttrig tt0234215 switch" 
        putquick "$imdb_pub :\00308\[Search Titles\]\017 $imdb::api::info_strig the matrix reloaded | or | $imdb::api::info_strig the matrix reloaded --switch" 
        putquick "$imdb_pub :\00308\[Search Switches\]\017 title year rated released genre director writer cast plot poster runtime rating votes link | no switch = spam :D" 
  } 
} 


#//end all 
}

Last edited by SpiKe^^ on Tue Feb 12, 2013 12:38 pm, edited 3 times in total.
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
Post Reply