抢淘宝众筹

狗日的迅雷耍猴,玩客云抢了几天没抢到,没办法撸了个脚本半自动抢,果真抢到了。我不是黄牛撸1个就够,共享出来大家玩下。注意:我不是前端程序员,代码Low不许喷。

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         抢淘宝众筹
// @namespace    https://github.com/clhey/tampermonkey/tree/master/izhongchou
// @version      0.2.3
// @description  狗日的迅雷耍猴,玩客云抢了几天没抢到,没办法撸了个脚本半自动抢,果真抢到了。我不是黄牛撸1个就够,共享出来大家玩下。注意:我不是前端程序员,代码Low不许喷。
// @author       查理
// @match        https://izhongchou.taobao.com/dreamdetail.htm?*
// @require      https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    console.log('Fuck淘宝众筹loaded!');

    var id = getQueryString('id');
    var buyUrl = 'https://izhongchou.taobao.com/order/confirm_order.htm?itemId=';

    window.setInterval(checkStock, 500);


    //functions---------------------------------------------------------------------
    function checkStock() {
        $.ajax({
            type: 'get',
            url: '/dream/ajax/getProjectForDetail.htm?id=' + id,
            dataType: 'json',
            success: function(data) {
                for (var i in data.data.items) {
                    var item = data.data.items[i];
                    if (item.can_buy > 0) {
                        window.location.href = buyUrl + item.item_id;
                        return;
                    }
                }
                console.log('not start, recheck!');
            }
        });
    }


    function getQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if (r !== null) return unescape(r[2]);
        return null;
    }


})();