Skip to content

Instantly share code, notes, and snippets.

@glasslion
Created December 29, 2016 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glasslion/f5e1a85b3267400634e0f494e50b3121 to your computer and use it in GitHub Desktop.
Save glasslion/f5e1a85b3267400634e0f494e50b3121 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Piratebay Helper
// @description
// @namespace https://userscripts.org/users/glasslion
// @include *pirate*
// @license MIT
// @version 0.1
// @require https://code.jquery.com/jquery-2.1.3.min.js
// @grant GM_addStyle
// @grant GM_setClipboard
// ==/UserScript==
GM_addStyle('#searchResult tr:nth-child(5n+1) { background: #ffe0b2 !important; }');
GM_addStyle('#searchResult tr:nth-child(5n+2) { background: #ffcc80 !important; }');
GM_addStyle('#searchResult tr:nth-child(5n+3) { background: #ffb74d !important; }');
GM_addStyle('#searchResult tr:nth-child(5n+4) { background: #ffa726 !important; }');
GM_addStyle('#searchResult tr:nth-child(5n+5) { background: #ff9800 !important; }');
$('.download a').click(
function (event) {
event.preventDefault();
download_link = event.target;
magnet_url = $(download_link).attr('href');
GM_setClipboard(magnet_url);
}
)
$magnet_image =
$('#searchResult a[title="Download this torrent using magnet"]').click(
function (event) {
event.preventDefault();
download_link = event.target;
magnet_url = $(download_link).parent().attr('href');
GM_setClipboard(magnet_url);
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment