// ==UserScript==
// @name Links on Netflix - IMDB, Metacritic, Rotten Tomatoes
// @description Add search links to Netflix titles
// @version 0.1
// @author mica
// @namespace greasyfork.org/users/12559
// @include https://www.netflix.com/*
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js
// @grant none
// @downloadURL none
// ==/UserScript==
(function() {
$('style').html(`
a.slnk {margin: 4px 6px 0 4px;}
a.slnk img {width: 20px; height: 20px;}
`).appendTo('head');
var url;
setInterval(function() {
if (url != location.href) {
url = location.href;
setTimeout(function() {
$('a.slnk').remove();
if ($('.title:last').text() != '') {
var title = $('.title:last').text();
} else {
var title = $('img.logo:last').attr('alt');
}
var imdb = 'http://www.imdb.com/find?s=tt&ref_=fn_tt&q=' + title;
$('').attr('href', imdb).attr('target', '_blank').addClass('slnk')
.html('
')
.appendTo('div.meta:last');
var mc = 'http://www.metacritic.com/search/all/' + title + '/results?cats[movie]=1&cats[tv]=1&search_type=advanced';
$('').attr('href', mc).attr('target', '_blank').addClass('slnk')
.html('
')
.appendTo('div.meta:last');
var rt = 'https://www.rottentomatoes.com/search/?search=' + title;
$('').attr('href', rt).attr('target', '_blank').addClass('slnk')
.html('
')
.appendTo('div.meta:last');
}, 1100);
}
}, 300);
})();