Last active
March 14, 2019 23:45
-
-
Save spig/39ca22aa1ff6275252ff81cc9007c7fd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Hide Rated R Movies on Feature Films page | |
// @namespace http://stevespiga.rel.li/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author Steve Spigarelli | |
// @match https://www.slcolibrary.org/mm/mmmo/newFeatureFilms.htm | |
// @grant none | |
// ==/UserScript== | |
$.expr[':'].icontains = function(a, i, m) { | |
return jQuery(a).text().toUpperCase() | |
.indexOf(m[3].toUpperCase()) >= 0; | |
}; | |
(function() { | |
'use strict'; | |
// find all author class element with 'rated r' in the text - hide the parent div | |
$(".author:icontains('rated r')").each(function(i, ele) { $(ele.closest("div.maincol")).hide(); }); | |
// add rotten tomatoes search to each movie | |
$('.itemdescr').each(function(idx, item) { var title = $(item).find('strong'); $(title).wrap('<a href="https://www.rottentomatoes.com/search/?search='+$(title).text()+'" target="_blank">Rotten Tomatoes</a>'); }); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment