diff --git a/disabled_plugins/rottentomatoes.py b/disabled_plugins/rottentomatoes.py
deleted file mode 100755
index bbac607..0000000
--- a/disabled_plugins/rottentomatoes.py
+++ /dev/null
@@ -1,37 +0,0 @@
-from util import http, hook
-
-api_root = 'http://api.rottentomatoes.com/api/public/v1.0/'
-movie_search_url = api_root+'movies.json?q=%s&apikey=%s'
-movie_info_url = api_root+'movies/%s.json?apikey=%s'
-movie_reviews_url = api_root+'movies/%s/reviews.json?apikey=%s&review_type=all'
-
-response = u"%s - critics: \x02%d%%\x02 (%d\u2191%d\u2193) audience: \x02%d%%\x02 - %s"
-
-
-@hook.command('rt')
-def rottentomatoes(inp, bot=None):
- '.rt
-- gets ratings for from Rotten Tomatoes'
-
- api_key = bot.config.get("api_keys", {}).get("rottentomatoes", None)
- if not api_key:
- return None
-
- title = inp.strip()
-
- results = http.get_json(movie_search_url % (http.quote_plus(title), api_key))
- if results['total'] > 0:
- movie = results['movies'][0]
- title = movie['title']
- id = movie['id']
- critics_score = movie['ratings']['critics_score']
- audience_score = movie['ratings']['audience_score']
- url = movie['links']['alternate']
-
- if critics_score != -1:
- reviews = http.get_json(movie_reviews_url%(id, api_key))
- review_count = reviews['total']
-
- fresh = critics_score * review_count / 100
- rotten = review_count - fresh
-
- return response % (title, critics_score, fresh, rotten, audience_score, url)
diff --git a/plugins/metacritic.py b/plugins/metacritic.py
index 6d2ed6e..e86809d 100755
--- a/plugins/metacritic.py
+++ b/plugins/metacritic.py
@@ -131,7 +131,7 @@ def metacritic(inp):
except IndexError:
score = None
- return '[%s] %s - \x02%s/100\x02, %s -- %s' % (plat.upper(), name,
+ return '[%s] %s - \x02%s/100\x02, %s - %s' % (plat.upper(), name,
score or 'no score',
'release: \x02%s\x02' % release if release else 'unreleased',
link)
diff --git a/plugins/rottentomatoes.py b/plugins/rottentomatoes.py
new file mode 100644
index 0000000..af3d8db
--- /dev/null
+++ b/plugins/rottentomatoes.py
@@ -0,0 +1,39 @@
+from util import http, hook
+
+api_root = 'http://api.rottentomatoes.com/api/public/v1.0/'
+movie_search_url = api_root + 'movies.json'
+movie_reviews_url = api_root + 'movies/%s/reviews.json'
+
+
+@hook.command('rt')
+def rottentomatoes(inp, bot=None):
+ 'rt -- gets ratings for from Rotten Tomatoes'
+
+ api_key = bot.config.get("api_keys", {}).get("rottentomatoes", None)
+ if not api_key:
+ return "error: no api key set"
+
+ title = inp.strip()
+
+ results = http.get_json(movie_search_url, q=title, apikey=api_key)
+ if results['total'] == 0:
+ return 'No results.'
+
+ movie = results['movies'][0]
+ title = movie['title']
+ id = movie['id']
+ critics_score = movie['ratings']['critics_score']
+ audience_score = movie['ratings']['audience_score']
+ url = movie['links']['alternate']
+
+ if critics_score == -1:
+ return
+
+ reviews = http.get_json(movie_reviews_url % id, apikey=api_key, review_type='all')
+ review_count = reviews['total']
+
+ fresh = critics_score * review_count / 100
+ rotten = review_count - fresh
+
+ return u"{} - Critics Rating: \x02{}%\x02 ({} liked, {} disliked) " \
+ " Audience Rating: \x02{}%\x02 - {}".format(title, critics_score, fresh, rotten, audience_score, url)
\ No newline at end of file