WWT Easy Updater

Adds update button to "Your Torrents" page

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 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);
  });
});