Adding IMDb ratings to BBC iPlayer films - a greasemonkey script
Posted by Howard Richardson (comments: 2)
How better to waste an hour on a Sunday afternoon than cooking up a Greasemonkey script that automatically adds in the IMDb ratings for all the films currently on the BBC iPlayer films page: http://www.bbc.co.uk/iplayer/tv/categories/films
// ==UserScript==
// @name IMDB Ratings in BBC iPlayer
// @namespace www.sqtl.co.uk
// @grant GM_xmlhttpRequest
// @description Adds ratings from IMDB to films in iPlayer
// @include http://www.bbc.co.uk/iplayer/tv/categories/films
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
//
// ==/UserScript==
// New version, changed to use omdbapi instead
$('ul.episodelist>li').each(function(i){
var cache_this = this;
currentTitleChunk = $(this).find('span.title');
currentTitle = currentTitleChunk.text();
console.log(currentTitle);
GM_xmlhttpRequest({
method: "GET",
url: "http://www.omdbapi.com/?t=" + currentTitle,
onload: function(response) {
var foo_result=jQuery.parseJSON(response.responseText);
var rating=foo_result.imdbRating;
$(cache_this).find('span.title').append(' ('+rating+' on IMDb)');
}
});
} );
Add a comment
Comment by Graham |
Thanks for this. Really useful. It'll really help choosing which film (if any) to watch!
Comment by M |
Any way to only display one's own ratings instead of the average?