// ==UserScript== // @name Create Summary From IMDb [User+][KAT] // @namespace PXgamer // @description Creates a summary from any IMDB page. // @include *kat.cr/*-i*/* // @include *imdb.com/title/tt* // @include *imdb.com/search/title?* // @author PXgamer // @version 1.2 // @grant none // @downloadURL none // ==/UserScript== var url = window.location.pathname; var elem; var summary; var summaryCustom = '
Set Custom Summary
'; var movieid; /* PAGES */ if (/.*-i\d{5,7}\//.test(url)) { /* KAT Metadata Page */ /* remove blankrefer :D */ $('.dataList [href*="www.imdb.com/title/tt"]').attr('href', $('.dataList [href*="www.imdb.com/title/tt"]').attr('href').split('?')[1]); if (window.location.search.length > 6) { summary = (window.location.search.substring(6)); movieid = $('.dataList [href*="imdb.com/title/tt"]').text(); if ($('.movieCover img[src=""]').length) { /* If no metadata */ $('.dataList [href*="imdb.com/title/tt"]').after(' '); /* For when was not auto */ generateMetadata(); /* Auto generate some */ }else if (!$('#summary > div').length){ /* If summary isn't there */ addSummary(); /* Auto create summary */ } } }else if(/\/synopsis$/.test(url)) { movieid = window.location.pathname.split('tt')[1].split('/')[0]; $('.summary_text[itemprop="description"]').before(summaryCustom); }else if (/\/title\/tt/.test(url)) { movieid = window.location.pathname.split('tt')[1].split('/')[0]; if (!$('[itemprop="description"] [href^="/updates?"]').length) { var descOne = $('[itemprop="description"]'); $('#titleStoryLine [itemprop="description"] p *').remove(); var secondSynopsis = $('#titleStoryLine [itemprop="description"] p').html(); if (descOne.find('a[href*="/plotsummary?"]').length) { /* Read more */ descOne.html(secondSynopsis); descOne.find('*').remove(); }else{ descOne.after('Second Summary
'+ ''+secondSynopsis+'
'+ '