Links on Netflix - IMDB, Metacritic, Rotten Tomatoes

Add search links to Netflix titles

Versione datata 11/10/2016. Vedi la nuova versione l'ultima versione.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         Links on Netflix - IMDB, Metacritic, Rotten Tomatoes
// @description  Add search links to Netflix titles
// @version      0.1
// @author       mica
// @namespace    greatest.deepsurf.us/users/12559
// @include      https://www.netflix.com/*
// @require      https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js
// @grant        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;
                $('<a>').attr('href', imdb).attr('target', '_blank').addClass('slnk')
                    .html('<img src="http://i.media-imdb.com/images/favicon.ico">')
                        .appendTo('div.meta:last');
                var mc = 'http://www.metacritic.com/search/all/' + title + '/results?cats[movie]=1&cats[tv]=1&search_type=advanced';
                $('<a>').attr('href', mc).attr('target', '_blank').addClass('slnk')
                    .html('<img src="http://www.metacritic.com/favicon.ico">')
                        .appendTo('div.meta:last');
                var rt = 'https://www.rottentomatoes.com/search/?search=' + title;
                $('<a>').attr('href', rt).attr('target', '_blank').addClass('slnk')
                    .html('<img src="https://staticv2.rottentomatoes.com/static/images/icons/favicon.ico">')
                        .appendTo('div.meta:last');
            }, 1100);
        }
    }, 300);
})();