// ==UserScript==
// @name Links on Netflix - IMDB, Metacritic, Rotten Tomatoes
// @description Add search links to Netflix titles
// @version 0.3
// @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() {
$('head').append(``);
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 = 'https://www.imdb.com/find?s=tt&ref_=fn_tt&q=' + encodeURIComponent(title);
$('').attr('href', imdb).attr('target', '_blank').addClass('slnk')
.html('
')
.appendTo('div.meta:last');
var mc = 'https://www.metacritic.com/search/all/' + encodeURIComponent(title.replace(/\*|\//g,' ')) + '/results';
$('').attr('href', mc).attr('target', '_blank').addClass('slnk')
.html('
')
.appendTo('div.meta:last');
var rt = 'https://www.rottentomatoes.com/search/?search=' + encodeURIComponent(title);
$('').attr('href', rt).attr('target', '_blank').addClass('slnk')
.html('
')
.appendTo('div.meta:last');
}, 1100);
}
}, 300);
})();