18P2P thanks by one_click

18P2P一键感谢

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name           18P2P thanks by one_click
// @description    18P2P一键感谢
// @include        *
// @require        http://code.jquery.com/jquery-latest.min.js
// @author         congxz6688
// @version        2015.8.13.0
// @grant          GM_log
// @namespace https://greasyfork.org/scripts/167
// ==/UserScript==


if(document.title.indexOf("18P2P -")!=-1 && (window.location.href.indexOf("viewthread.php")!=-1|| window.location.href.indexOf("redirect.php")!=-1)){
	var formhash=$('[name="formhash"]').val();
	var mainurl=$('[href*="thankyou.php"]')[0].href;
	$('[href*="thankyou.php"]:has(img)').attr({"href":""}).click(function(){
		GM_log("开始运行一键感谢程序……")
		var urll = mainurl + "&thankyousubmit=1&formhash="+formhash+"&reason=Thanks";
		var autothank = new XMLHttpRequest();
		autothank.open('POST', urll, false);
		autothank.onreadystatechange = callback;
		autothank.send(null);
		function callback(){
			GM_log("一键感谢 ok!")
			window.location.reload();
		}
	})
}