aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar jesopo2018-07-02 11:09:02 +0100
committerGravatar jesopo2018-07-02 11:09:02 +0100
commit464510cd80068a54a1d1e151b8fcbcb0af000ef4 (patch)
treeef484b4f17fdcfd927c8954c59026f3120b356a0
parentFixed small type in IRCServer (diff)
signature
OMDBAPI now needs an api key
-rw-r--r--bot.json.example3
-rw-r--r--modules/imdb.py7
2 files changed, 8 insertions, 2 deletions
diff --git a/bot.json.example b/bot.json.example
index e08c85a6..14fc0dd5 100644
--- a/bot.json.example
+++ b/bot.json.example
@@ -16,5 +16,6 @@
"tfl-api-id" : "",
"tfl-api-key" : "",
"eagle-api-url" : "",
- "eagle-api-key" : ""
+ "eagle-api-key" : "",
+ "omdbapi-api-key" : ""
}
diff --git a/modules/imdb.py b/modules/imdb.py
index 0c03556a..c24b4c0a 100644
--- a/modules/imdb.py
+++ b/modules/imdb.py
@@ -1,3 +1,5 @@
+#--require-config omdbapi-api-key
+
import json
import Utils
@@ -7,13 +9,16 @@ URL_IMDBTITLE = "http://imdb.com/title/%s"
class Module(object):
_name = "IMDb"
def __init__(self, bot):
+ self.bot = bot
bot.events.on("received").on("command").on("imdb").hook(
self.imdb, min_args=1,
help="Search for a given title on IMDb",
usage="<movie/tv title>")
def imdb(self, event):
- page = Utils.get_url(URL_OMDB, get_params={"t": event["args"]},
+ page = Utils.get_url(URL_OMDB, get_params={
+ "t": event["args"],
+ "apikey": self.bot.config["omdbapi-api-key"]},
json=True)
if page:
if "Title" in page: