Greasy Fork

Greasy Fork is available in English.

New Filtered Netflix

A replacement for the filtered Netflix of the past. Written in a bit of a drunken rage. I got around the now lack of Netflix API by checking the boxes that popup and looking for a rating, and then saving the info into localStorage. Thus, it will not filter things until you've hovered over them once.

当前为 2014-09-04 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name       		New Filtered Netflix
// @namespace  		http://www.netflix.com/
// @version    		0.1
// @description  	A replacement for the filtered Netflix of the past. Written in a bit of a drunken rage. I got around the now lack of Netflix API by checking the boxes that popup and looking for a rating, and then saving the info into localStorage. Thus, it will not filter things until you've hovered over them once.
// @match      		http://*.netflix.com/*
// @require    		http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js
// @copyright  		2014+, Nigel Fish
// @author     		Nigel Fish
// ==/UserScript==

$(document).ready(function() {
    
    function hideThatTitleYo(title) {
        var selector = 'img[alt="' + title + '"]';
            $(selector).css({
                '-webkit-filter' : 'grayscale(100%)',
                '-moz-filter' : 'grayscale(100%)',
                '-o-filter' : 'grayscale(100%)',
                '-ms-filter': 'grayscale(100%)',
                'filter': 'grayscale(100%)',
                'opacity': '0.4'
            });
    }
    
    var titles = JSON.parse(localStorage.getItem("filteredTitlesYo"));
    if (titles === null) {
        titles = {};
    } else {
        //loop and hide
        for (var key in titles) {            
            hideThatTitleYo(key);
        }
    }        
    
    $('.boxShot').hover(function() {
        //check if we've rated this movie
        var movieTitle = $(this).find('.boxShotImg').attr('alt');
        //check the popup box name
        //wait a second first
        setTimeout(function() {
            var bobContent = $('.bobContent');
            var bobTitle = bobContent.find('.bobMovieHeader .title').html();
            if (bobTitle != undefined) bobTitle = bobTitle.trim();
            //check if movie watched
            if ((bobContent).find('.sbmfrt').length != 0) {
                //store locally that it was watched and shade image
                titles[bobTitle] = true;
                localStorage.setItem("filteredTitlesYo", JSON.stringify(titles));
                hideThatTitleYo(bobTitle);
            }
            
        }, 1000);
        
    });
});