WWT Easy Updater

Adds update button to "Your Torrents" page

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        WWT Easy Updater
// @namespace   Keka_Umans
// @description Adds update button to "Your Torrents" page
// @require     https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @include     *worldwidetorrents.eu/account.php?action=mytorrents
// @include     *worldwidetorrents.eu/account.php?action=mytorrents&page=*
// @version     1.4
// @grant       none
// ==/UserScript==


$(window).load(function(){
  $('table.w3-table tr').each(function(i){
    if (i===0) {
      $(this).append('<th class="w3-centered" width="120"><a href="#" class="updateAll">Update All</th>');
    }
    else {
      $(this).append('<td align="center" class="w3-jose"><a href="#" class="quickUpdate" data-href="'+($('a[href^="torrents-details.php?id="]', this).attr('href'))+'&scrape=1">Update</a></td>');
    }
  });
// Update All Torrents
// you can all thank PX for most of this bit
  var allTorrents = $('a.quickUpdate');
  $('.updateAll').click(function(e){
    e.preventDefault();
    alert('Scraping of torrents will take a few minutes');
    for(var i=0;i<allTorrents.length;i++){
      allTorrents[i].click();
    }
  });
// Update Single Torrent
  $('.quickUpdate').click(function(e){
    e.preventDefault();
    var link = $(this).data('href').replace('&hit=1','');
    $.get(link);
  });
});