Skip to content

Instantly share code, notes, and snippets.

@sfdye
Created February 2, 2018 08:39
Show Gist options
  • Save sfdye/cdfab9d98ad2f2561c5cf06cddfb4d38 to your computer and use it in GitHub Desktop.
Save sfdye/cdfab9d98ad2f2561c5cf06cddfb4d38 to your computer and use it in GitHub Desktop.
user.js
// ==UserScript==
// @name apactix抢票
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 一个在apactix上抢票的小助手
// @author sfdye
// @match https://booking.apactix.com/*
// @grant none
// ==/UserScript==
// 设置抢票张数
const ticAmount = 8;
// 设置抢票区域
const section = "B";
(function() {
'use strict';
var areaObj = getAreaBySec(section);
if (areaObj) {
// 设置区域
jQuery('div#section-sel').html('YOUR PREFERRED SECTION IS <big>'+ areaObj.description.replace(/ *\<[^)]*\> */g, "") + '</big>');
assignPrice(areaObj);
}
var ticQuantity = document.getElementById("qty_0");
// 设置张数
if (ticQuantity) ticQuantity.value = ticAmount;
var capKey = document.getElementById("capKey");
if (capKey) capKey.focus();
var addtocart = document.getElementById("addtocart-btn");
if (addtocart) {
// 提交
addtocart.click();
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment