Skip to content

Instantly share code, notes, and snippets.

@spig
Last active March 14, 2019 23:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spig/39ca22aa1ff6275252ff81cc9007c7fd to your computer and use it in GitHub Desktop.
Save spig/39ca22aa1ff6275252ff81cc9007c7fd to your computer and use it in GitHub Desktop.
// ==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