Skip to content

Instantly share code, notes, and snippets.

@Koli14
Last active July 12, 2019 17:34
Show Gist options
  • Save Koli14/9e679f5266095905d61c18919b694ac4 to your computer and use it in GitHub Desktop.
Save Koli14/9e679f5266095905d61c18919b694ac4 to your computer and use it in GitHub Desktop.
Hide watched movies on ncore.cc with greasmonkey
// ==UserScript==
// @name ncore.hide.films.user.js
// @namespace mytool
// @include https://ncore.cc/torrents.php*
// @version 1.1
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @require http://userscripts-mirror.org/scripts/source/107941.user.js
// @grant GM_setValue
// @grant GM_getValue
// @description Hide movies on ncore.cc with greasmonkey
// ==/UserScript==
function hide_film(film){
var hideme = $('span').filter(function () {
return $(this).text().toLowerCase() == film.toLowerCase();
});
hideme.parents('.box_torrent').hide();
}
function hide_films(films) {
$.each(films, function (index, value) {
hide_film(value);
});
}
var stored_films = GM_SuperValue.get('HiddenFilms', []);
hide_films(stored_films);
$('.lista_fej').append('<span class=\'clear_list\' style=\'float:right; cursor: pointer; margin-right: 10px; font-size: 14px;\'>Clear Hidden Films History </span>');
$('.clear_list').click(function(){
GM_SuperValue.set('HiddenFilms', []);
location.reload();
});
$('.siterank').append('<span class=\'myhide\' style=\'cursor: pointer; margin-left: 10px; font-size: 14px;\'>Hide</span>');
$('.myhide').click(function () {
var hide_this = this.parentNode.firstChild.nextSibling.innerHTML;
if (hide_this !== undefined) {
var found = jQuery.inArray(hide_this, stored_films);
if (found < 0) {
stored_films.push(hide_this);
}
GM_SuperValue.set('HiddenFilms', stored_films);
hide_film(hide_this);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment