Skip to content

Instantly share code, notes, and snippets.

@fisknils
Created December 23, 2019 13:32
Show Gist options
  • Save fisknils/30cd637eda70d2e1133313acb8d8ff72 to your computer and use it in GitHub Desktop.
Save fisknils/30cd637eda70d2e1133313acb8d8ff72 to your computer and use it in GitHub Desktop.
Userscript: IMDB.com/title/* parental nudity rating
// ==UserScript==
// @name Nudity scraper
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Nudity is everywhere in modern media. If you're not bothered by it, you probably dont even realize it. This script makes the process of finding a clean movie a little less tedious by replacing the "Rate this" link on the top of the single movie page to the content from nudity rating on the parental-guide.
// @author Fisknils
// @include https://www.imdb.com/title/*
// @grant none
// ==/UserScript==
jQuery(document).ready(function($){
let title_url = location.href.replace(/\?.*/,'');
const scrape_nudity = ( data ) => {
let nudity_rating = $('#advisory-nudity .ipl-status-pill', data).text();
$('.star-rating-button').html(`<p>Nudity: ${nudity_rating}</p>`);
$('.star-rating-button').wrap('<a target="_blank" href="parentalguide">');
}
$.get(`${title_url}parentalguide/`, scrape_nudity);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment