sp1ti / Fade collected nzbgeek

// ==UserScript==
// @name         Fade collected nzbgeek
// @namespace    https://nzbgeek.info
// @version      0.8
// @description  Fade things of no interest.
// @author       sp1ti
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @require      https://git.io/vMmuf
// @match        https://nzbgeek.info/geekseek.php?c=2030*
// @match        https://nzbgeek.info/geekseek.php?c=2010*
// @connect      <domain where the IDs are stored. ex. blablabla.com>
// @grant        GM_addStyle
// @grant        GM_setValue
// @grant        GM_getValue
// @grant        GM_deleteValue
// @grant        GM_xmlhttpRequest
// @grant        GM_log
// @license      MIT
// ==/UserScript==

function fade() {
    'use strict';

    if(GM_getValue("imdbids") !== "loadedx"){
        GM_xmlhttpRequest({
            method: "GET",
            url: "<URL to the IMDBid file>",
            onload: function(response) {
                var imdb = response.responseText;
                var imdb_ids = imdb.split(",");
                imdb_ids.forEach(function(item) {
                    var imdb_id = item;
                    //console.log(item);
                    GM_setValue(imdb_id, "1");
                });
            }
        });
        GM_setValue("imdbids", "loadedx");
        console.log("Done importing");
    }

    var imdb_links = document.querySelectorAll ("a[href*='http://www.dereferer.org/?http://www.imdb.com/title/tt']");
    for(var i = 0, l = imdb_links.length; i < l; i++) {
        var imdb_id = 0;
        var imdb_id_entry = 0;

        var torrent = imdb_links[i];
        imdb_id = torrent.href.replace("http://www.dereferer.org/?http://www.imdb.com/title/", "");
        imdb_id = imdb_id.replace("/", "");
        //console.log(imdb_id);

        imdb_id_entry = GM_getValue(imdb_id);
        if(imdb_id_entry !== undefined && imdb_id_entry !== "0"){
            //$("tr.lista2:has('a[href*='imdb_id']')").hide ();
            //imdb_id = "tt2960270";
            //$("tr.HighlightTVRow2:has('a[href*='imdb_id']')").hide();
            $("tr.HighlightTVRow2:has('a[href*='" + imdb_id + "']')").hide();
        }
    }

}
fade();