this is my first post in this forum and I'm pretty sure I'm already botching it (probably wrong section) but I stumbled into something cool and I wanted to share it with the other criticker users.
I was looking for userscripts for criticker but couldn't find much, so I started experimenting with scripts meant for other sites. I mostly wanted to grab the ratings from imdb and rottentomatoes (mostly to check out how wrong they are compared to my taste )
I installed this script for greasemonkey in firefox: http://userscripts-mirror.org/scripts/show/167800
then I added this to the included pages: https://www.criticker.com*
and this is the result:
the information is added at the bottom of the page next to the imdb link [imdb rating/number of ratings].
I have no knowledge of javascript whatsoever so I am not capable of making it look prettier, all I know is that this script takes the information from http://www.omdbapi.com. that api also has rottentomatoes and metacritic ratings. it also has a number of other data which for now are not on criticker, so there must be a way to include those too. for example movie lenght and parental rating would be cool to have.
this is the whole thing for "Cobra":
http://www.omdbapi.com/?i=tt0090859&plo ... rue&r=json
I hope this was of some interest to someone.
by the way I love this site, have been here since forever and it never gets a recommendation wrong.
keep up the great work.
------------------------------------ edit 2016.09.22 -------------------------------------------------------
ok I fooled around with it a little and I managed to add much more information. this is what it looks like now:
as I said I have zero knowledge of javascript so I basically just winged it. I mostly just did this for myself and I don't plan to publish this anywhere but if anyone else is interested this is what you do
1. install the original script in firefox with greasemonkey
2. go through the options and open the script editor
3. copy this code:
Code: Select all
// ==UserScript==
// @name IMDb ratings
// @author gonzoid
// @description Adds ratings on IMDb search results and name pages using third party OMDb API.
// @version 2013-05-18
// @namespace http://userscripts.org/scripts/show/167800
// @grant GM_xmlhttpRequest
// @downloadURL http://userscripts.org/scripts/source/167800.user.js
// @updateURL http://userscripts.org/scripts/source/167800.user.js
// ==/UserScript==
var IMDBpluginlinks = document.links;
var IMDBcontinueelement = document.createElement("button");
IMDBcontinueelement.innerHTML = "Get rating";
function processIMDBLinks(s){
IMDBcontinueelement.style.display = 'none';
var r=0;
for (IMDBi = s; IMDBi < IMDBpluginlinks.length; IMDBi++) {
if (IMDBpluginlinks[IMDBi].href.indexOf("/title/") != -1 && IMDBpluginlinks[IMDBi].href.indexOf("imdb.") != -1){
if(r>300){
IMDBcontinueelement.onclick=function(){ processIMDBLinks(IMDBi); };
IMDBcontinueelement.style.display='inline';
IMDBpluginlinks[IMDBi].parentNode.insertBefore(IMDBcontinueelement, IMDBpluginlinks[IMDBi]);
break;
}
r++;
GM_xmlhttpRequest({
method: 'get',
headers: {},
url: "http://www.omdbapi.com/?i=" + IMDBpluginlinks[IMDBi].href.match(/tt\d+/) + "&plot=short&tomatoes=true&r=json",
onload: function (IMDBi) {return function (result) {
var rating = JSON.parse(result.responseText).imdbRating;
var meta = JSON.parse(result.responseText).Metascore;
var runtime = JSON.parse(result.responseText).Runtime;
var tomatoMeter = JSON.parse(result.responseText).tomatoMeter;
var Rated = JSON.parse(result.responseText).Rated;
var Released = JSON.parse(result.responseText).Released;
var Genre = JSON.parse(result.responseText).Genre;
var Director = JSON.parse(result.responseText).Director;
var Writer = JSON.parse(result.responseText).Writer;
var Actors = JSON.parse(result.responseText).Actors;
var Plot = JSON.parse(result.responseText).Plot;
var Language = JSON.parse(result.responseText).Language;
var Country = JSON.parse(result.responseText).Country;
var Awards = JSON.parse(result.responseText).Awards;
var tomatoUserMeter = JSON.parse(result.responseText).tomatoUserMeter;
var BoxOffice = JSON.parse(result.responseText).BoxOffice;
var Production = JSON.parse(result.responseText).Production;
IMDBpluginlinks[IMDBi].parentNode.insertBefore(document.createElement("span"), IMDBpluginlinks[IMDBi]).innerHTML = ((rating !== "N/A") ? "<br><br><b>Parental Rating:</b> " + Rated + " <br><br><b>Runtime:</b> " + runtime + " <br><br><b>Awards:</b> " + Awards + " <br><br><b>BoxOffice:</b> " + BoxOffice + " <br><br><b>IMDb:</b> " + rating + " <br><b>tomatoAudience:</b> " + tomatoUserMeter + "% <br><b>Metacritic:</b> " + meta + " <br><b>tomatoMeter:</b> " + tomatoMeter + "% <br><br><b>Produced by:</b> " + Production + " <br><br><b>Genres:</b> " + Genre + " <br><br><b>Directed by:</b> " + Director + " <br><br><b>Written by:</b> " + Writer + " <br><br><b>Starring:</b> " + Actors + " <br><br><b>Summary:</b> " + Plot + " <br><br><b>Language:</b> " + Language + " <br><br><b>Country:</b> " + Country + " <br><br><b>Original Release Date:</b> " + Released + " <br><br>" : "<b style='color: red'>[N/A]</b> ");
}}(IMDBi)
});
}
}
}
processIMDBLinks(0);
4. paste it in the script editor replacing everything.
5. save the whole thing and you're done.
of course add https://www.criticker.com* in the included pages list. also the info seems to be appearing in other random sites. just add the urls in the excluded sites list.
if anyone with more knowledge and skills wants to edit this and make it better feel free to do it. it wasn't mine to begin with
------------------------------------ edit 2016.09.25 ----------------------------------------------------
great to see it's working for other users too!
just wanted to add that this shouldn't be a firefox only thing. if your browser supports extentions and there's one for userscripts you can install it too. I think the one for google chrome is called tampermonkey. I only tested this on firefox tho, so if you try it with other browsers you're on your own. maybe post your results in the comments for others to follow