| View previous topic :: View next topic |
| Author |
Message |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 792 Location: Tennessee, USA
|
Posted: Sat Feb 16, 2013 6:08 pm Post subject: |
|
|
When you get home, paste the exact errors here, because looks to me like that should have worked. _________________ SpiKe^^
Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
. |
|
| Back to top |
|
 |
spithash Master

Joined: 12 Jul 2007 Posts: 248 Location: Libera
|
Posted: Sat Feb 16, 2013 6:41 pm Post subject: |
|
|
That is the error I got:
| Code: | | Tcl error [imdb::imdb_evaluate_search::search_evaluate_imdb]: wrong # args: should be "putserv text ?options?" |
When I tried to:
| Code: | | putserv "$imdb_pub :\00308\[Cast\]\017 $actors" - \00308\[Plot\]\017 $plot" |
_________________ Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl |
|
| Back to top |
|
 |
Madalin Master

Joined: 24 Jun 2005 Posts: 310 Location: Constanta, Romania
|
Posted: Sat Feb 16, 2013 6:46 pm Post subject: |
|
|
Try
| Quote: |
putserv "PRIVMSG $imdb_pub :\00308\[Cast\]\017 $actors" - \00308\[Plot\]\017 $plot" |
_________________ https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sat Feb 16, 2013 7:09 pm Post subject: |
|
|
You've got a quote in there, just after $actors. Remove it, or escape it using \ _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
spithash Master

Joined: 12 Jul 2007 Posts: 248 Location: Libera
|
Posted: Sat Feb 16, 2013 7:18 pm Post subject: |
|
|
same error my friend
here is what i've changed
| Code: | putserv "PRIVMSG $imdb_pub :\00308\[Link\]\017 http://www.imdb.com/title/$id/" - \00308\[Title\]\017 $title \00308\[Year\]\017 $year \00308\[Genre\]\017 $genre" - \00308\[Directed By\]\017 $director \00308\[Writen By\]\017 $writer" - \00308\[Released\]\017 $released \00308\[Rated\]\017 $rated"
putserv "PRIVMSG $imdb_pub :\00308\[Cast\]\017 $actors" - \00308\[Plot\]\017 $plot"
putserv "PRIVMSG $imdb_pub :\00308\[Runtime\]\017 $runtime \00308\[Rating\]\017 $rating \00308\[Votes\]\017 $votes" - \00308\[Poster\]\017 $poster"
|
_________________ Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl |
|
| Back to top |
|
 |
spithash Master

Joined: 12 Jul 2007 Posts: 248 Location: Libera
|
Posted: Sat Feb 16, 2013 7:26 pm Post subject: |
|
|
| nml375 wrote: | | You've got a quote in there, just after $actors. Remove it, or escape it using \ |
okay, here's where I got so far:
EDIT:
| Code: | putserv "PRIVMSG $imdb_pub :\00308\[Link\]\017 http://www.imdb.com/title/$id/ - \00308\[Title\]\017 $title \00308\[Year\]\017 $year \00308\[Genre\]\017 $genre - \00308\[Directed By\]\017 $director \00308\[Writen By\]\017 $writer - \00308\[Released\]\017 $released \00308\[Rated\]\017 $rated"
putserv "PRIVMSG $imdb_pub :\00308\[Cast\]\017 $actors - \00308\[Plot\]\017 $plot"
putserv "PRIVMSG $imdb_pub :\00308\[Runtime\]\017 $runtime \00308\[Rating\]\017 $rating \00308\[Votes\]\017 $votes - \00308\[Poster\]\017 $poster"
|
_________________ Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl
Last edited by spithash on Sat Feb 16, 2013 7:27 pm; edited 1 time in total |
|
| Back to top |
|
 |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 792 Location: Tennessee, USA
|
Posted: Sat Feb 16, 2013 7:26 pm Post subject: |
|
|
| Code: | putserv "$imdb_pub :\00308\[Link\]\017 http://www.imdb.com/title/$id/ - \00308\[Title\]\017 $title \00308\[Year\]\017 $year \00308\[Genre\]\017 $genre - \00308\[Directed By\]\017 $director \00308\[Writen By\]\017 $writer - \00308\[Released\]\017 $released \00308\[Rated\]\017 $rated"
putserv "$imdb_pub :\00308\[Cast\]\017 $actors - \00308\[Plot\]\017 $plot"
putserv "$imdb_pub :\00308\[Runtime\]\017 $runtime \00308\[Rating\]\017 $rating \00308\[Votes\]\017 $votes - \00308\[Poster\]\017 $poster" |
_________________ SpiKe^^
Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
. |
|
| Back to top |
|
 |
Madalin Master

Joined: 24 Jun 2005 Posts: 310 Location: Constanta, Romania
|
Posted: Sat Feb 16, 2013 7:27 pm Post subject: |
|
|
Remove the PRIVMSG part from what i said and then remove the quote " after $actors
| Code: |
putserv "$imdb_pub :\00308\[Link\]\017 http://www.imdb.com/title/$id/ - \00308\[Title\]\017 $title \00308\[Year\]\017 $year \00308\[Genre\]\017 $genre - \00308\[Directed By\]\017 $director \00308\[Writen By\]\017 $writer - \00308\[Released\]\017 $released \00308\[Rated\]\017 $rated"
putserv "$imdb_pub :\00308\[Cast\]\017 $actors - \00308\[Plot\]\017 $plot"
putserv "$imdb_pub :\00308\[Runtime\]\017 $runtime \00308\[Rating\]\017 $rating \00308\[Votes\]\017 $votes - \00308\[Poster\]\017 $poster"
|
_________________ https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL |
|
| Back to top |
|
 |
spithash Master

Joined: 12 Jul 2007 Posts: 248 Location: Libera
|
Posted: Sat Feb 16, 2013 7:31 pm Post subject: |
|
|
Worked like a charm guys! thank you a lot
EDIT:
So if anyone wants to try it with the truncated "theme" I am using, down to 3 lines, here it is:
| Code: | putserv "$imdb_pub :\002\[Link\]\017 http://www.imdb.com/title/$id/ \00304-\017 \002\[Title\]\017 $title \002\[Year\]\017 $year \00304-\017 \002\[Genre\]\017 $genre \00304-\017 \002\[Directed By\]\017 $director \00304-\017 \002\[Writen By\]\017 $writer \00304-\017 \002\[Released\]\017 $released \00304-\017 \002\[Rated\]\017 $rated \00304-\017 \002\[Runtime\]\017 $runtime \00304-\017 \002\[Rating\]\017 $rating \00304-\017 \002\[Votes\]\017 $votes"
putserv "$imdb_pub :\002\[Cast\]\017 $actors \00304-\017 \002\[Plot\]\017 $plot"
putserv "$imdb_pub :\002\[Poster\]\00303 $poster" |
I changed a bit the colors and added a seperator (colored as well)
Enjoy  _________________ Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl |
|
| Back to top |
|
 |
x0x Op
Joined: 10 Feb 2009 Posts: 140
|
Posted: Mon Feb 18, 2013 4:18 am Post subject: |
|
|
It is a great script indeed. This is the lay-out I use:
| Code: | putquick "$imdb_pub :\0033Title:\003 \002$title\002 \u00E2\u0080\u00A2 \0033Year:\003 $year \u00E2\u0080\u00A2 \0033Rated:\003 $rated \u00E2\u0080\u00A2 \0033Genre:\003 $genre"
putquick "$imdb_pub :\0033Director:\003 $director \u00E2\u0080\u00A2 \0033Actors:\003 $actors"
putquick "$imdb_pub :\0033Rating:\003 \002$rating\002/10 \u00E2\u0080\u00A2 \0033Runtime:\003 $runtime \u00E2\u0080\u00A2 \0033URL:\003 http://imdb.com/title/$id" |
The year matching works fantastic. Really nice! |
|
| Back to top |
|
 |
SVD Voice
Joined: 13 Mar 2006 Posts: 9
|
Posted: Tue Feb 26, 2013 8:44 pm Post subject: |
|
|
Thanks to the previous posters who worked on this. Here is the layout I use:
| Code: | putserv "$imdb_pub :\002$title ($year) \00304/\017 \002Directed By:\017 $director \00304/\017 http://www.imdb.com/title/$id/"
putserv "$imdb_pub :\002Genre:\017 $genre \00304/\017 \002Rated:\017 $rated"
putserv "$imdb_pub :\002Cast:\017 $actors"
putserv "$imdb_pub :\002Rating:\017 $rating ($votes votes) \00304/\017 \002Runtime:\017 $runtime"
putserv "$imdb_pub :\002Plot:\017 $plot" |
Example:
Idiocracy (2006) / Directed By: Mike Judge / http://www.imdb.com/title/tt0387808/
Genre: Adventure, Comedy, Sci-Fi, Thriller / Rated: R
Cast: Luke Wilson, Maya Rudolph, Dax Shepard, Terry Crews
Rating: 6.4 (66,264 votes) / Runtime: 1 h 24 min
Plot: Private Joe Bauers, the definition of 'average American', is selected by the Pentagon to be the guinea pig for a top-secret hibernation program. Forgotten, he awakes 500 years in the future. He discovers a society so incredibly dumbed-down that he's easily the most intelligent person alive.
Full script:
| 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 {
putserv "$imdb_pub :\002$title ($year) \00304/\017 \002Directed By:\017 $director \00304/\017 http://www.imdb.com/title/$id/"
putserv "$imdb_pub :\002Genre:\017 $genre \00304/\017 \002Rated:\017 $rated"
putserv "$imdb_pub :\002Cast:\017 $actors"
putserv "$imdb_pub :\002Rating:\017 $rating ($votes votes) \00304/\017 \002Runtime:\017 $runtime"
putserv "$imdb_pub :\002Plot:\017 $plot"
}
}
}
}
# 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 |
Last edited by SVD on Wed Feb 27, 2013 6:10 pm; edited 1 time in total |
|
| Back to top |
|
 |
delinquent Voice
Joined: 08 Feb 2013 Posts: 11 Location: Undernet #ACAB
|
Posted: Wed Feb 27, 2013 5:33 pm Post subject: |
|
|
can you post the fixed script ?  |
|
| Back to top |
|
 |
spithash Master

Joined: 12 Jul 2007 Posts: 248 Location: Libera
|
Posted: Thu Apr 04, 2013 1:52 pm Post subject: |
|
|
How about adding AWARDS as well in the script?
Just a suggestion, people asking me about awards all the time.
 _________________ Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl |
|
| Back to top |
|
 |
x0x Op
Joined: 10 Feb 2009 Posts: 140
|
Posted: Mon Apr 08, 2013 12:44 pm Post subject: |
|
|
| Anyone able to return results for the 2013 Tom Cruise movie 'Oblivion'? When I search for Oblivion it returns a 90s movie. When I search for Oblivion 2013 it returns another movie titled Oblivion from 2013. |
|
| Back to top |
|
 |
SoUkSoU Voice
Joined: 11 Jan 2014 Posts: 13
|
Posted: Mon Jan 20, 2014 10:14 am Post subject: Problem |
|
|
This dont work on me:
| Code: | putserv "$imdb_pub :\002\[Link\]\017 http://www.imdb.com/title/$id/ \00304-\017 \002\[Title\]\017 $title \002\[Year\]\017 $year \00304-\017 \002\[Genre\]\017 $genre \00304-\017 \002\[Directed By\]\017 $director \00304-\017 \002\[Writen By\]\017 $writer \00304-\017 \002\[Released\]\017 $released \00304-\017 \002\[Rated\]\017 $rated \00304-\017 \002\[Runtime\]\017 $runtime \00304-\017 \002\[Rating\]\017 $rating \00304-\017 \002\[Votes\]\017 $votes"
putserv "$imdb_pub :\002\[Cast\]\017 $actors \00304-\017 \002\[Plot\]\017 $plot"
putserv "$imdb_pub :\002\[Poster\]\00303 $poster" |
at the first line it stops at Directed By and dont showing the other info like " writer,releases,rated,runtime,rating and votes. " |
|
| Back to top |
|
 |
|