Repository: sopel-irc/sopel

Issue:
imdb module not working anymore
I just noticed that anytime you make a call to imdb now the bot responds: 

> [MOVIE] No API key provided.

I know it used to work, not sure how recently. Maybe it can be switched to a different database that doesn't require an API key?


Discussion:
OMDb API made the API private :/ Read more here: https://www.omdbapi.com
Private? That's dumb. :(
It is. But I guess they need to get the money from somewhere!
So, no alternative, eh? I noticed rbot's imdb plugin still works. See https://github.com/ruby-rbot/rbot/blob/master/data/rbot/plugins/imdb.rb for its code. Can someone port it to Sopel's Python? I am not a coder. :/
Rbot doesn't use the ombd API but instead read the imdb page directly. This
is a "dirtier" way to do it in my opinion, but the only (free) option at
the moment.

Might as well use that method. :/
If you know Python, go on! I could probably do it if I had time, but I
think that I will have some busy weeks this summer.

"... Can someone port it to Sopel's Python? I am not a coder. :/ ..." in my original post. ;) However, I am willing to test it!
Oops, I didn't read it, sorry. Well, I will add that to my to-do list.
Let's see if I find time to do it!

Works again with https://github.com/sopel-irc/sopel/pull/1195
Awesome. Now, I wait for the pip's release whenever that is. :/
I'm 95% sure there will be another pip release before the heat death of the universe, at least.
When is the heat death of the universe? ;)
[A very long time in the future.](https://en.wikipedia.org/wiki/Heat_death_of_the_universe#Time_frame_for_heat_death)
> I'm 95% sure there will be another pip release before the heat death of the universe, at least.

What I didn't know is that it would end up being my job to publish it, haha. Working toward 6.5.2 right now, which could include a fix for this issue if @kwaaak and/or @freeboson are available to rebase #1195 and update the tests.
#1195 is scheduled for 6.6.0, so I'm punting this issue as well to match.
Thanks dgw. :)
Punting again, as #1195 no longer appears to work as-is (and was itself removed from 6.6.0).

Resolving patch:
diff --git a/conftest.py b/conftest.py
--- a/conftest.py
+++ b/conftest.py
@@ -1,2 +1,2 @@
 # This file lists files which should be ignored by pytest
-collect_ignore = ["setup.py", "sopel.py", "sopel/modules/ipython.py", "sopel/modules/movie.py"]
+collect_ignore = ["setup.py", "sopel.py", "sopel/modules/ipython.py"]
diff --git a/sopel/modules/movie.py b/sopel/modules/movie.py
deleted file mode 100644
--- a/sopel/modules/movie.py
+++ /dev/null
@@ -1,50 +0,0 @@
-# coding=utf-8
-"""
-imdb.py - Sopel Movie Information Module
-Copyright © 2012-2013, Elad Alfassa, <elad@fedoraproject.org>
-Licensed under the Eiffel Forum License 2.
-
-This module relies on omdbapi.com
-"""
-from __future__ import unicode_literals, absolute_import, print_function, division
-
-import requests
-import sopel.module
-from sopel.logger import get_logger
-
-LOGGER = get_logger(__name__)
-
-
-@sopel.module.commands('movie', 'imdb')
-@sopel.module.example('.movie ThisTitleDoesNotExist', '[MOVIE] Movie not found!')
-@sopel.module.example('.movie Citizen Kane', '[MOVIE] Title: Citizen Kane | Year: 1941 | Rating: 8.4 | Genre: Drama, Mystery | IMDB Link: http://imdb.com/title/tt0033467')
-def movie(bot, trigger):
-    """
-    Returns some information about a movie, like Title, Year, Rating, Genre and IMDB Link.
-    """
-    if not trigger.group(2):
-        return
-    word = trigger.group(2).rstrip()
-    uri = "http://www.omdbapi.com/"
-    data = requests.get(uri, params={'t': word}, timeout=30,
-                        verify=bot.config.core.verify_ssl).json()
-    if data['Response'] == 'False':
-        if 'Error' in data:
-            message = '[MOVIE] %s' % data['Error']
-        else:
-            LOGGER.warning(
-                'Got an error from the OMDb api, search phrase was %s; data was %s',
-                word, str(data))
-            message = '[MOVIE] Got an error from OMDbapi'
-    else:
-        message = '[MOVIE] Title: ' + data['Title'] + \
-                  ' | Year: ' + data['Year'] + \
-                  ' | Rating: ' + data['imdbRating'] + \
-                  ' | Genre: ' + data['Genre'] + \
-                  ' | IMDB Link: http://imdb.com/title/' + data['imdbID']
-    bot.say(message)
-
-
-if __name__ == "__main__":
-    from sopel.test_tools import run_example_tests
-    run_example_tests(__file__)


Test patch: