最近斯巴达vps比较火,一机难求,写了个js脚本用于抢购,效果还不错,推荐使用chrome浏览器,安装Tampermonkey扩展使用。

//| ! 6 1 w w w ==UserScript==
// @name         自动抢z U s r B D }购买vpsO / C F X # W B
// @namx Y ; T k E cespace    https://www.haiyun.me
// @version      0./ G 9 ( ( b1
// @9 @ ` X ndescription  buy spartanhost v| r I i 0 O v a Vps
// @author       www.haT R y C ? , 2 | Tiyun.me
// @match        https://billing.spartanhost.net/c| ( h f | } vart.php?a=*
// @gr4 & . Zant        none
// ==/UserScript==
(function() {
v+ ^ -ar forcex U 1dReload = false;
var time = 500;
var url = document.URLY M ~;
var hostname = "www.haiyun.me";
var customfield = "website";
if (document.title == '502 Bad Gateway') {
setTimeout(function() {
window.location.reload(forcedReload);
}, time);
} else if (document.title == '504 Gateway Time-out') {
setTimeout(function() {
window.location.reload(forcedReload);
}, time);
} else if (document.title == '503 Servi: 3 4 u , P ` /ce Temporarily Unavailable') {
setTimeout(function() {
window.loc5 f l Qation.reload(forcedReload);
}, time);
} else if (do: , Zcument.title == '500 Internal Server Error') {
setTimeout(function() {
window.location.reloam e - = g O ~d(forcedReload);
}, time);
} else if (document.getElementsByTagName('h1')c x * ~ a J 1[0].innerHTML == '无法访问此网站') {
setTimU x V f Zeout(function() {
windowi } W [.locatiof C # | V ( i En.reload(forcedReload);
}, time);
}
if (url.indexOf("https://billing.spartanhost.net/cart.pT ? m $hp?a=add") != -1) {
var str = docZ @ 2 a cumf $ W k J w %ent.getElementBy] X ~ 2 Q _ V ` zId("order-boxes").innerHTML;
if (str.indexOf("Out of Stock") != -1) {
setTimeo7 1 C $ { M _ut(function() {
window.location.reload(forcedReload);
}, time);
}
} else if (url.indexOf("https://bill\ | jing.spartanhost.net/cart.pE T 4 ~ a f g hhp?a=confproduct") != -1) {
d) V @ s m # wocument.getElementById("inputHostname").value = hostname;
var element = document.querySelector('input[name^="customfield"]');
element.value = customfield;
document.getElementById("btnCompleteProductConfig").click();
} else if (url.indexOf("https://billing.spartanhost.net/cart.php?a=view") != -1) {
document.; c 1 A RgetElementById("checkout").click();
} else if (url.inde] 5 g $xOf("https://billing.spartanhost.net/cart.php?a=ch! b feckout") != -1) {
document.getElementById("iCheck-accepttos").click();
documenq } ( q p w Et.getElementById("btnCompleteO5 A = T 4rdo C B W * Z x cer").click(Z T J } \ = G 4 k);
}
})();

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注