egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

imdbapi.com v1
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
liljim
Voice


Joined: 11 Dec 2007
Posts: 12

PostPosted: Mon Feb 11, 2013 11:23 pm    Post subject: Reply with quote

SpiKe^^ wrote:
Try this untested patch to the script.
# to add channels, do: .chanset #somechan +imdbapi


Unfortunately it's not working. When I do -imdb I get Tcl error [imdb::imdb_evaluate_search::search_evaluate_imdb]: can't read "imdb": no such variable and when doing ??imdb I get Tcl error [imdb::imdb_helper::helper_imdb]: can't read "imdb": no such variable
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Tue Feb 12, 2013 12:19 am    Post subject: Fixed I hope Reply with quote

Sorry bout that.

Edited the prior fixed script and it should be good now.

Try it again and see if it works.
_________________
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
Back to top
View user's profile Send private message Visit poster's website
liljim
Voice


Joined: 11 Dec 2007
Posts: 12

PostPosted: Tue Feb 12, 2013 1:42 am    Post subject: Reply with quote

Now ??imdb works, but -imdb returns Tcl error [imdb::imdb_evaluate_search::search_evaluate_imdb]: can't read "imdb_pub": no such variable


Also, this isn't an error on your part, but imdbapi.com needs to be changed to omdbapi.com since they changed urls. It'll help people in the future that might not read every word of every post.
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Tue Feb 12, 2013 2:08 am    Post subject: Fixed I hope Reply with quote

Believe I got it this time:)

Edited the above script again to fix the most recent error &
Fixed the link info to reflect the new address.

Please let me know if it still has issues.
_________________
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
Back to top
View user's profile Send private message Visit poster's website
liljim
Voice


Joined: 11 Dec 2007
Posts: 12

PostPosted: Tue Feb 12, 2013 2:34 am    Post subject: Reply with quote

It seems to work perfectly now. Thank you very much!
Back to top
View user's profile Send private message
liljim
Voice


Joined: 11 Dec 2007
Posts: 12

PostPosted: Tue Feb 12, 2013 2:57 am    Post subject: Reply with quote

I'm sorry, there's one more bug. When using -tt alone, instead of returning Usage: -tt tt1899353 there's an error Tcl error [imdb::imdb_evaluate::evaluate_imdb]: can't read "imdb::api::info_ttrig": no such variable

You left out an extra t. So instead of

Code:
if {$ttid==""} {putquick "$imdb_pub :Usage: $imdb::api::info_ttrig tt1899353";return}


it should say

Code:
if {$ttid==""} {putquick "$imdb_pub :Usage: $imdb::api::info_tttrig tt1899353";return}


Now it's perfect Smile Thanks again!
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Tue Feb 12, 2013 12:45 pm    Post subject: Reply with quote

hmmm, that's not my error, but I fixed it in the code above.

That code was part of the original script we were patching, so would also affect the first script posted by doggo
_________________
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
Back to top
View user's profile Send private message Visit poster's website
x0x
Op


Joined: 10 Feb 2009
Posts: 140

PostPosted: Wed Feb 13, 2013 6:02 pm    Post subject: Reply with quote

nml375 wrote:
As for the "more elegant" version:
Code:
} 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.


Now !imdb matrix does not work but !imdb Matrix does. Same with the other fix mentioned above by adding A-Z to the already a-z0-9

Anyone a solution?
Back to top
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Wed Feb 13, 2013 9:54 pm    Post subject: Reply with quote

x0x wrote:
Now !imdb matrix does not work but !imdb Matrix does. Same with the other fix mentioned above by adding A-Z to the already a-z0-9

Anyone a solution?


The issue here is the fellow was running into issues with characters in the url path. He wasn't using http packages handy http::formatQuery option. Instead he was mapping spaces to + and trying to sanitize input. This reduces the complexity and completeness of the search, crippling it.

Here is a new version, works with all characters (yes, even those special characters }{$\"), even foreign languages although the script is written in english output only. All credit to doggo. If you find yourself using this script, consider it beerware. Put quite simple, you owe doggo a beer. If you can't afford to buy him a beer via paypal there is an optional means of payment: Take a picture of yourself drinking a beer. The background of this picture should be a monitor displaying your irc channel with this scripts output among what is displayed. Put a short personal message to doggo and we have proper payment. Enjoy the script everyone Wink

Note: Uses the version Spike^^ provided so includes any code fixes he made as well...

Code:
# 13/02/2013
# 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 + $imdb_flood(lasttime,$chan) - [clock seconds] }] seconds and try again."
            return
         }
         set titleid [split [stripcodes bcruag $titleid]]
         if {![string length [set ttid [lindex $titleid 0]]]} {
            putquick "$imdb_pub :Usage: $imdb::api::info_tttrig tt1899353"
            return
         }
         set action [lindex $titleid 1]
         if {![regexp {^tt([0-9]+)$} $ttid match imdbid] } {
            putquick "$imdb_pub :Error: not a valid ttid."
            return
         }
         if {![catch { ::http::geturl $imdb::api::ttsearch_url=tt$imdbid -timeout 15000 } token]} {
            set information [::http::data $token]
            ::http::cleanup $token
            if {![regexp -nocase {response\"\:\"(.*?)\"} $information match response]} {
               putquick "$imdb_pub :$imdb::api::ttsearch_url=tt$imdbid timed out.. try again in a bit "
               return
            } elseif {![string match "True" $response]} {
               putquick "$imdb_pub :Error: Unknown IMDb ID"
               return
            }
            ::imdb::imdb_trigger::trigger_imdb $information $action $chan
         } else {
            putquick "$imdb_pub :Error: $token"
            return
         }
         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 imdbsearch} {
         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 + $imdb_flood(lasttime,$chan) - [clock seconds] } ] seconds and try again."
            return
         }
         if {![llength [set imdbsearch [split [stripcodes bcruag $imdbsearch]]]]} {
            putquick "$imdb_pub :Usage: $imdb::api::info_strig Mission Impossible"
            return
         }
         if {[string index [set imdbswitch [lindex $imdbsearch end]] 0] == "-"} {
            set imdbsearch [join [lrange $imdbsearch 0 end-1]]
            set imdbswitch [string range $imdbswitch 1 end]
         } else {
            set imdbswitch ""
            set imdbsearch [join $imdbsearch]
         }
         if {![catch { ::http::geturl $imdb::api::titlesearch_url=[http::formatQuery $imdbsearch] -timeout 15000 } token]} {
            set information [::http::data $token]
            ::http::cleanup $token
            regexp -nocase {response\"\:\"(.*?)\"} $information match response
            if {![info exists response]} {
               putquick "$imdb_pub :Error: $imdb::api::titlesearch_url=[http::formatQuery $imdbsearch] timed out.. try again in a bit "
               return
            } elseif {![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: $token"
            return
         }
         set imdb_flood(lasttime,$chan) [clock seconds]
      }
   }

   # parse the returned json proc
   namespace eval imdb_trigger {
      proc trigger_imdb {information action chan} {
         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  }
         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"
      }
   }
}

#eof

_________________
speechles' eggdrop tcl archive
Back to top
View user's profile Send private message
x0x
Op


Joined: 10 Feb 2009
Posts: 140

PostPosted: Thu Feb 14, 2013 5:31 am    Post subject: Reply with quote

Thanks, this works indeed!

Last edited by x0x on Thu Feb 14, 2013 7:21 am; edited 1 time in total
Back to top
View user's profile Send private message
x0x
Op


Joined: 10 Feb 2009
Posts: 140

PostPosted: Thu Feb 14, 2013 7:13 am    Post subject: Reply with quote

Would it be possible to include the 'year' filter?

!imdb Oblivion

This returns a 1995 movie. There is no way for me to display the upcoming 2013 movie.

Maybe it's possible to filter out year and add it as &y=XXXX to the get request?

!imdb Oblivion 2013

This should create the following get request:

http://www.omdbapi.com/?i=&t=Oblivion&y=2013

And doggo, respond to my PM on EFnet last week. I would like to buy you a beer.
Back to top
View user's profile Send private message
doggo
Halfop


Joined: 05 Jan 2010
Posts: 97

PostPosted: Fri Feb 15, 2013 11:54 am    Post subject: Reply with quote

thanks to spike and speechless for the additions Very Happy

ive added a bit to catch the year tested a lil works great!!


Code:
# 15/02/2013
# 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"

   }
   #binds
   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 + $imdb_flood(lasttime,$chan) - [clock seconds] }] seconds and try again."
            return
         }
         set titleid [split [stripcodes bcruag $titleid]]
         if {![string length [set ttid [lindex $titleid 0]]]} {
            putquick "$imdb_pub :Usage: $imdb::api::info_tttrig tt1899353"
            return
         }
         set action [lindex $titleid 1]
         if {![regexp {^tt([0-9]+)$} $ttid match imdbid] } {
            putquick "$imdb_pub :Error: not a valid ttid."
            return
         }
         if {![catch { ::http::geturl $imdb::api::ttsearch_url=tt$imdbid -timeout 15000 } token]} {
            set information [::http::data $token]
            ::http::cleanup $token
            if {![regexp -nocase {response\"\:\"(.*?)\"} $information match response]} {
               putquick "$imdb_pub :$imdb::api::ttsearch_url=tt$imdbid timed out.. try again in a bit "
               return
            } elseif {![string match "True" $response]} {
               putquick "$imdb_pub :Error: Unknown IMDb ID"
               return
            }
            ::imdb::imdb_trigger::trigger_imdb $information $action $chan
         } else {
            putquick "$imdb_pub :Error: $token"
            return
         }
         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 imdbsearch} {
         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 + $imdb_flood(lasttime,$chan) - [clock seconds] } ] seconds and try again."
            return
         }
         if {![llength [set imdbsearch [split [stripcodes bcruag $imdbsearch]]]]} {
            putquick "$imdb_pub :Usage: $imdb::api::info_strig Mission Impossible"
            return
         }
         set yearvar "";
         if {[regexp {([0-9]{4})} $imdbsearch match yearvar]} {
           regsub -all {([0-9]{4})} $imdbsearch {} imdbsearch
         }
         if {[string index [set imdbswitch [lindex $imdbsearch end]] 0] == "-"} {
            set imdbsearch [join [lrange $imdbsearch 0 end-1]]
            set imdbswitch [string range $imdbswitch 1 end]
         } else {
            set imdbswitch ""
            set imdbsearch [join $imdbsearch]
         }
         if {$yearvar == ""} {
         set omdbsearchurl "$imdb::api::titlesearch_url=[http::formatQuery $imdbsearch]"
         } else {
         set omdbsearchurl "$imdb::api::titlesearch_url=[http::formatQuery $imdbsearch]&y=[http::formatQuery $yearvar]"
         }
         #putquick "$imdb_pub :$omdbsearchurl"
         if {![catch { ::http::geturl $omdbsearchurl -timeout 15000 } token]} {
            set information [::http::data $token]
            ::http::cleanup $token
            regexp -nocase {response\"\:\"(.*?)\"} $information match response
            if {![info exists response]} {
               putquick "$imdb_pub :Error: $omdbsearchurl timed out.. try again in a bit "
               return
            } elseif {![string match "True" $response]} {
               putquick "$imdb_pub :Error: 0 Results for $imdbsearch $yearvar "
               return
            }
            ::imdb::imdb_trigger::trigger_imdb $information $imdbswitch $chan
         } else {
            putquick "$imdb_pub :Error: $token"
            return
         }
         set imdb_flood(lasttime,$chan) [clock seconds]
      }
   }
   # parse the returned json proc
   namespace eval imdb_trigger {
      proc trigger_imdb {information action chan} {
         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  }
         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"
      }
   }
}
#eof





glad to hear its a usefull script, any errors let me know tried a few searchs with years and seemed good

enjoy!


/me loves beer! get the .tcl here Very Happy
_________________
NON geeky!! http://gotcode4u.com/
Back to top
View user's profile Send private message Visit poster's website
spithash
Master


Joined: 12 Jul 2007
Posts: 248
Location: Libera

PostPosted: Sat Feb 16, 2013 3:09 am    Post subject: Reply with quote

what if we want to make it post 2-3 lines instead of 8?
_________________
Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Sat Feb 16, 2013 3:29 am    Post subject: Reply with quote

edit these default reply lines:)

Code:
            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/"
            }

_________________
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
Back to top
View user's profile Send private message Visit poster's website
spithash
Master


Joined: 12 Jul 2007
Posts: 248
Location: Libera

PostPosted: Sat Feb 16, 2013 8:18 am    Post subject: Reply with quote

Edit them like how exactly?
When I try to make it for example like this:

Code:
 putquick "$imdb_pub :\00308\[Cast\]\017 $actors" - \00308\[Plot\]\017 $plot"


It stops showing that line. it somehow complains about the order...i'm not at home and I don't have logs with me to post right now...

Any examples would help Smile
_________________
Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Goto page Previous  1, 2, 3, 4  Next
Page 2 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber