Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update movie.py to use omdbapi as imdbapi is non-functional #925

Merged
merged 2 commits into from
Nov 14, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions sopel/modules/movie.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Copyright © 2012-2013, Elad Alfassa, <[email protected]>
Licensed under the Eiffel Forum License 2.

This module relies on imdbapi.com
This module relies on omdbapi.com
"""
from __future__ import unicode_literals
import json
Expand All @@ -25,17 +25,17 @@ def movie(bot, trigger):
if not trigger.group(2):
return
word = trigger.group(2).rstrip()
uri = "http://www.imdbapi.com/?t=" + word
uri = "http://www.omdbapi.com/?t=" + word
u = web.get(uri, 30)
data = json.loads(u) # data is a Dict containing all the information we need
if data['Response'] == 'False':
if 'Error' in data:
message = '[MOVIE] %s' % data['Error']
else:
LOGGER.warning(
'Got an error from the imdb api, search phrase was %s; data was %s',
'Got an error from the OMDb api, search phrase was %s; data was %s',
word, str(data))
message = '[MOVIE] Got an error from imdbapi'
message = '[MOVIE] Got an error from OMDbapi'
else:
message = '[MOVIE] Title: ' + data['Title'] + \
' | Year: ' + data['Year'] + \
Expand Down