Redacted.ch :: Requests Auto-Subscriber (Created/Voted)

Requests will be directly subscribed if created or voted

目前為 2019-07-26 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        Redacted.ch :: Requests Auto-Subscriber (Created/Voted)
// @description Requests will be directly subscribed if created or voted
// @include     https://*redacted.ch/requests.php?action=view&id=*
// @require     https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js
// @icon        https://redacted.ch/favicon.ico
// @version     1.0.3
// @grant       GM_getValue

// @namespace https://greasyfork.org/users/2290
// ==/UserScript==
 
/* This should automatically subscribe to your new request once the request is submitted and the resulting page has loaded */
var usernum = document.documentElement.innerHTML.match(/user\.php\?id\=[0-9]+/)[0].split("?")[1];

var pageid = document.URL.split("=")[2];
var page = 'requests';

var str1 = usernum;

// Converting the userid to only numbers from API
var userid = str1.replace(/[^0-9]/g, '');

// We get all people who have voted/created the request
var str2 = $(".layout").html();

// Extraction of all userid's possible
var number = str2.replace(/[^0-9]/g, '');

// Getting the current subscribing status
var status_subscribe = $("#subscribelink_" + page + pageid).text();

// If the userid is found and we can subscribe to the release, let's do it!
if(number.indexOf(userid) > -1 && status_subscribe == "Subscribe"){
    SubscribeComments(page, pageid);
}