ipt-better

Make IPTorrents less annoying, mainly by removing donation/lottery clutter

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

You will need to install an extension such as Tampermonkey to install this script.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name        ipt-better
// @namespace   https://github.com/furwasalreadytaken
// @description Make IPTorrents less annoying, mainly by removing donation/lottery clutter
// @include     https://ipt-update.com/*
// @include     https://www.ipt-update.com/*
// @include     https://iptorrents.com/*
// @include     https://www.iptorrents.com/*
// @version     3
// @grant       GM_addStyle
// ==/UserScript==

// execute the script in the context of the page so we don't need to load jquery again
// nasty, but you know, javscript
// https://stackoverflow.com/questions/14901036
function execute(body) {
    var el = document.createElement("script");
    el.textContent = "(" + body + ")();";
    document.body.appendChild(el);
    return el;
}

execute(function() {
  // make the banner link to the torrents page, not donate
  $(".banner a:first").attr('href', 'https://' + window.location.host + '/t');

  // hide the donate button from the main menu
  $(".butRow a:last").remove();

  // hide the "double your upload" banner
  $('td a[href="/donate.php"]').remove();

  // hide the lottery points indictator thing
  // FIXME: is there not a huge banner ala double your upload when the lottery is active?
  $('.stats div:nth-child(2) a[href="/lottery.php"]').remove();

  // hide the IPT Browser button
  $('.topRow a:contains("IPT Browser")').remove();

  // hide the sketchy-ass non-tls mirrors stuff
  $('.topRow a:contains("Mirrors")').remove();
  $('td a[href="/p/4334880"]').remove(); // "UK members can't access IPT? Use Mirrors!" banner

  // fix their stupid inconsistent 1337 spelling
  // column, row, new text
  var table = [
    [5, 3, "Apps"],
    [5, 4, "Apps/Non-English"],
    [5, 5, "Audiobooks"],
    [5, 11, "Magazines/Newspapers"]
  ];
  for (var i = 0; i < table.length; i++) {
    // does javascript *really* not have a .format method?
    var t = table[i];
    $("td.bottom:nth-child("+t[0]+") label:nth-child("+t[1]+") span a").html(t[2]);
  }
});