Skip to content

Instantly share code, notes, and snippets.

@dvingerh
Last active July 21, 2018 16:08
Show Gist options
  • Save dvingerh/67535c462ebe1458fee9c16f096addfe to your computer and use it in GitHub Desktop.
Save dvingerh/67535c462ebe1458fee9c16f096addfe to your computer and use it in GitHub Desktop.
Makes it easier to visual identify freeleech torrents and torrents with no seeders on PTP
// ==UserScript==
// @name PTP Clear View Improved
// @namespace https://passthepopcorn.me
// @version 1.2
// @description Makes it easier to visually identify freeleech torrents and torrents with no seeders on PTP
// @author jax913, cammy
// @match https://passthepopcorn.me/torrents.php*
// @require https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js
// @grant MIT
// ==/UserScript==
jQuery(document).ready(function() {
jQuery('.basic-movie-list__torrent-row').each(function( val ) {
var foundFree = jQuery(this).find('.torrent-info__download-modifier--free');
var foundHalf = jQuery(this).find('.torrent-info__download-modifier--half');
if (jQuery.inArray('freetorrent=1',window.location.search.substring(1).split('&')) == true) {
if ( foundFree.length == 1 || foundHalf.length == 1 ) {
jQuery(this).css('opacity', '1');
}
else {
jQuery(this).css('opacity', '0.5');
}
}
if ( foundFree.length || foundHalf) {
jQuery(foundFree).css("color", "#41a85f").css("text-shadow", "0px 0px 2px #41a85f");
jQuery(foundHalf).css("color", "#41a85f").css("text-shadow", "0px 0px 2px #41a85f");
}
var foundSeeders = jQuery(this).find('.no-seeders').length != 1;
if (! foundSeeders) {
jQuery(this).css('opacity', '0.5');
}
});
jQuery('tr[class$="group_torrent_header"]').each(function( val ) {
var foundFree = jQuery(this).find('.torrent-info__download-modifier--free');
var foundHalf = jQuery(this).find('.torrent-info__download-modifier--half');
var foundSeeders = jQuery(this).find('.no-seeders').length != 1;
if (! foundSeeders) {
jQuery(this).css('opacity', '0.5');
}
if (foundFree || foundHalf) {
jQuery(foundFree).css("color", "#41a85f").css("text-shadow", "0px 0px 2px #41a85f");
jQuery(foundHalf).css("color", "#41a85f").css("text-shadow", "0px 0px 2px #41a85f");
}
});
jQuery('h2.text--center').find("span.time").css("color", "#d14841");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment