| View previous topic :: View next topic |
| Author |
Message |
skeletor1969 Voice
Joined: 25 Jul 2018 Posts: 8
|
Posted: Fri Aug 24, 2018 4:08 pm Post subject: |
|
|
If anyone is interested. I have found a working script that uses omdbapi and displays the imdb information. The only catch is you have to sign up for a free api key but thats it and it works perfectly. You can also change the bind from !movie to !imdb by uncommenting a line in the script.
[12:59pm] <~skeletor> !movie deadpool
[12:59pm] <&`slut> Deadpool (2016) R | 108 min | Action, Adventure, Comedy | 12 Feb 2016
[12:59pm] <&`slut> Cast: Ryan Reynolds, Karan Soni, Ed Skrein, Michael Benyaer
[12:59pm] <&`slut> Plot: A fast-talking mercenary with a morbid sense of humor is subjected to a rogue experiment that leaves him with accelerated healing powers and a quest for revenge.
[12:59pm] <&`slut> Metascore: 65, IMDB Rating: 8.0
[12:59pm] <&`slut> http://www.imdb.com/title/tt1431045/
https://www.m00nie.com/2018/02/movie-search-script-for-eggdrop-bot-using-api/
Just a thought. |
|
| Back to top |
|
 |
Dominatez Halfop

Joined: 14 Jan 2019 Posts: 46 Location: United Kingdom
|
Posted: Wed Aug 07, 2019 8:16 am Post subject: |
|
|
No longer works.
Has started spitting out the following error.
unexpected '<' in TOP mode
Anyone any ideas ? |
|
| Back to top |
|
 |
Fire-Fox Master

Joined: 23 Sep 2006 Posts: 270 Location: /dev/null
|
Posted: Fri Nov 01, 2019 6:04 pm Post subject: |
|
|
It dosn't work for me, i get
| Code: |
!imdb Beautiful Mind
Error in search mechanics - you probably need a newer version.
|
_________________ GreatZ
Fire-Fox | Denmark
Scripts: Relay | Store Text | TvMaze |
|
| Back to top |
|
 |
Gordon Voice
Joined: 04 Apr 2007 Posts: 34
|
Posted: Wed Mar 04, 2020 1:55 pm Post subject: |
|
|
| Madalin wrote: | Another script for does interested is:
| Code: |
# +-------------------------------------------------------------------------------------+
# | |
# | iMDB v1.0.0 |
# | |
# +-------------------------------------------------------------------------------------+
# | |
# | *** Website @ http://www.EggdropTCL.com |
# | *** GitHub @ http://github.com/MadaliNTCL/eggdrop-tcl |
# | |
# +-------------------------------------------------------------------------------------+
# | *** IRC Support: |
# | #EggdropTCL @ QuakeNET |
# | #EggdropTCL @ UnderNET |
# | #EggdropTCL @ EfNET |
# | |
# | *** Contact: |
# | Yahoo Messenger/Mail: madalinmen28@yahoo.com |
# | Google Mail : madalinmen28@gmail.com |
# | Skype Messenger : madalinmen28 |
# | |
# +-------------------------------------------------------------------------------------+
# + *** Commands *** |
# | +---------------+ |
# | [ OP - PUBLIC ] |
# | +---------------+ |
# | |
# | +++ !imdb <on/off> |
# +-------------------------------------------------------------------------------------+
bind PUBM - * imdb
bind PUBM - * imdb:pubm
package require json
package require http
package require tdom
setudef flag imdb
proc imdb:pubm {nick uhost hand chan arg} {
global temp
if {[string index $arg 0] in {! . `}} {
set temp(cmd) [string range $arg 1 end]
set temp(cmd) [lindex [split $temp(cmd)] 0]
set arg [join [lrange [split $arg] 1 end]]
} elseif {[isbotnick [lindex [split $arg] 0]]} {
set temp(cmd) [lindex [split $arg] 1]
set arg [join [lrange [split $arg] 2 end]]
} else { return 0 }
if {[info commands imdb:$temp(cmd)] ne ""} { imdb:$temp(cmd) $nick $uhost $hand $chan $arg }
}
proc imdb:imdb {nick uhost hand chan arg} {
global imdb iignore
switch -exact -- [lindex [split $arg] 0] {
on {
if {[isop $nick $chan]} {
channel set $chan +imdb
putserv "PRIVMSG $chan :\002$nick\002 - \00302Set channel mode \00306+imdb\0032 on \00304$chan"
}
}
off {
if {[isop $nick $chan]} {
channel set $chan -imdb
putserv "PRIVMSG $chan :\002$nick\002 - \00302Set channel mode \00306-imdb\0032 on \00304$chan"
}
}
}
}
proc imdb {nick uhost hand chan arg} {
global imdb iignore
if {![channel get $chan imdb]} { return }
## ++
set floodtime 10
## ++
if {![info exists iignore($nick)]} {
set iignore($nick) [unixtime]
utimer $floodtime [list unset -nocomplain iignore($nick)]
}
## ++
if {[expr [unixtime]-$iignore($nick)]>$floodtime} { putlog "ignoram"; return 0 }
regexp -all -nocase {(tt[0-9]{7})} $arg match imdbid
if {[catch {http::geturl http://www.omdbapi.com/?[http::formatQuery i $imdbid]} tok]} {
putlog "Socket error: $tok"
return 0
}
if {[http::status $tok] ne "ok"} {
set status [http::status $tok]
putlog "TCP error: $status"
return 0
}
if {[http::ncode $tok] != 200} {
set code [http::code $tok]
http::cleanup $tok
putlog "HTTP Error: $code"
return 0
}
set data [http::data $tok]
set parse [::json::json2dict $data]
set year [dict get $parse Year]
set title [dict get $parse Title]
set runtime [dict get $parse Runtime]
set genre [dict get $parse Genre]
set rating [dict get $parse imdbRating]
set votes [dict get $parse imdbVotes]
set plot [dict get $parse Plot]
set awards [dict get $parse Awards]
putserv "PRIVMSG $chan :\0031,8\002iMDB\002\003 - \00312$title\003 \037\[\037$runtime ($year)\037\]\037 \037\002/\002\037 \00306$genre\003 \037\002/\002\037 \002$rating\002 (\00302Votes\003: \00304$votes\003) \037\002/\002\037 Plot: \00310$plot\003 \037\002/\002\037 \00302Awards\003: \00304$awards"
}
putlog "++ \[ - \00304PUBLIC\003 - \00306loaded\003 * \00303iMDB\003 \]"
|
is triggered when imdb links are posted in the channel |
This script makes bot error with | Code: | | Socket error: can't read "imdbid": no such variable | on every message in the channel.
Can anyone advice how to fix it? |
|
| Back to top |
|
 |
|
|
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
|
|