笨猫博客

  • 🍟首页
  • 🍘目录
    • 🥝VPS教程
    • 🍾猫玩技术
    • 🍹干货分享
    • 🍏软件分享
    • 🍩一只猫
  • 🍋工具
    • 🌽IP路由追踪
    • 🍐域名Whois查询
    • 🥘域名被墙查询
    • 🍧IP正常检测
    • 🔥IP端口检测
    • 🍆短网址
    • 🐟VIP音乐播放
    • 🍯KMS激活
  • 🍓链接
  • 🍪联系
  • 🍱登录
    • 🥦登录
    • 🍒注册
关注互联网,生活,音乐,乐此不疲的一只笨猫
  1. 首页
  2. VPS教程
  3. 正文

Tampermonkey:油猴脚本自动抢购斯巴达spartanhost vps

2021-03-03 7740点热度 0人点赞 0条评论

最近斯巴达(SpartanHost)VPS比较火,一机难求,刚刚看到群友分享的js脚本用于抢购,效果还不错,推荐使用chrome浏览器,安装Tampermonkey扩展使用。

脚本:

// ==UserScript==
// @name         自动抢购买vps
// @namespace    https://www.haiyun.me
// @version      0.1
// @description  buy spartanhost vps
// @author       www.haiyun.me
// @match        https://billing.spartanhost.net/cart.php?a=*
// @grant        none
// ==/UserScript==
 
(function() {
    var forcedReload = false;
    var time = 500; 
    var url = document.URL;
    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 Service Temporarily Unavailable') {
        setTimeout(function() {
            window.location.reload(forcedReload);
        }, time);
    } else if (document.title == '500 Internal Server Error') {
        setTimeout(function() {
            window.location.reload(forcedReload);
        }, time);
    } else if (document.getElementsByTagName('h1')[0].innerHTML == '无法访问此网站') {
        setTimeout(function() {
            window.location.reload(forcedReload);
        }, time);
    }
 
    if (url.indexOf("https://billing.spartanhost.net/cart.php?a=add") != -1) {
        var str = document.getElementById("order-boxes").innerHTML;
        if (str.indexOf("Out of Stock") != -1) {
            setTimeout(function() {
                window.location.reload(forcedReload);
            }, time);
        }
    } else if (url.indexOf("https://billing.spartanhost.net/cart.php?a=confproduct") != -1) {
        document.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.getElementById("checkout").click();
    } else if (url.indexOf("https://billing.spartanhost.net/cart.php?a=checkout") != -1) {
        document.getElementById("iCheck-accepttos").click();
        document.getElementById("btnCompleteOrder").click();
    }
})();

使用方法:

安装Tampermonkey扩展。直接添加脚本使用,推荐使用chrome浏览器

添加完脚本直接登录账号,然后到想抢购的机器页面即可,如果页面语言不是英文,右上角把语言改成英文,会自动刷新页面,不需任何更改,可直接使用。

标签: 暂无
最后更新:2021-03-03

笨猫

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

最新 热点 随机
最新 热点 随机
SSL 证书申请工具 | 免费 HTTPS 证书网页在线申请 Let's Encrypt、ZeroSSL 等 HTTPS 证书 免登录 Afilmory - 一个现代化照片画廊网站 手把手教你用AdguradHome+SNIProxy自建DNS解锁服务器 WIN10系统彻底永久关闭自动更新 WinRAR 商业版下载安装和白嫖指南 Certbot申请谷歌免费SSL证书
SSL 证书申请工具 | 免费 HTTPS 证书网页在线申请 Let's Encrypt、ZeroSSL 等 HTTPS 证书 免登录手把手教你用AdguradHome+SNIProxy自建DNS解锁服务器Afilmory - 一个现代化照片画廊网站
【开源】RSS.Beauty - 让 RSS 变漂亮! HTC G2曝光 正式命名HTC Magic 卡通小图标 数秒为图片创建倒影,投影效果 xshell 5/6免费注册官方版本下载,非破解版 TeamViewer v15.2俄国大神开心版+绿色版+ 历史版本大全(Windows/MacOS/Android)
最近评论
萧瑟 发布于 1 天前(07月14日) 这个我也用了好久,不知道啥时候能上IP证书
梵蒂冈 发布于 1 周前(07月08日) 士大夫
HuangWei 发布于 4 周前(06月16日) 自己手动设置确实很烦,我之前使用过这个,感觉还不错,虽然已经不怎么维护了:https://githu...
龙笑天 发布于 2 个月前(05月25日) 一直用的萌咖的路过 :smile:
C 发布于 2 个月前(05月04日) 有个更省心的路子,上传到 catbox.moe,然后用 i0.wp.com 做加速(也支持heif格...
标签
elliptictrue100.10.02
BLOG ChatGPT Chrome CloudFlare DirectAdmin github Godaddy google kloxo Linux OneDrive OneIndex PHP QQ shadowsocks SNS ssh Typecho VPS web2.0 whmcs Windows wordpress 一键脚本 下载 免费 博客 图文教程 图标 图片 域名 头像 奥运 宝塔面板 插件 教程 日记 有趣 浏览器 游戏 猫 生活 电影 百度 网站 视频 设计 软件 阿里云盘 音乐
好友
  • glzjin's blog glzjin's blog
  • ZAERA博客
  • 冰沫记
  • 奇它博客
  • 猫腻‘s Blog
  • 猫饭
  • 肥宅之家
  • 萌博
  • 野路子程序员

COPYRIGHT © 2022 笨猫博客. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang