Created
December 29, 2016 14:44
-
-
Save glasslion/f5e1a85b3267400634e0f494e50b3121 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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