Greasy Fork

来自缓存

Greasy Fork is available in English.

美团叠加券

input输入要抢的点名

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         美团叠加券
// @namespace    http://tampermonkey.net/
// @version      1.0.2
// @description  input输入要抢的点名
// @author       You
// @match        https://offsiteact.meituan.com/web/hoae/collection_waimai_v7/index.html*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// @require      https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js
// @license      cacalot123

// ==/UserScript==

(function() {
    'use strict';
        setTimeout(()=>{
        $('<div style="position:fixed;right:0; top:300px;z-index: 99999;"><input type="text" id="wantName" /><button id="wantNameBotton">自动搜索</button></div>').appendTo('body')
        $("#wantNameBotton").click(()=>{
            const wantName = $('#wantName').val();
            if(!wantName){
                alert('请输入')
                return false
            }
            const dianName = []
            const interval = setInterval(function(){
                $("html, body").animate({ scrollTop: $(document).height() });
                $.each( $('.mb16'),function(index,value){
                    const name = $(value).find('.style_name__3ldZb').html();
                    const $btn = $(value).find('.style_btn__35tv_');
                    console.log('text',name)
                    dianName.push(name)
                    if(name === wantName && $.trim($btn.text()) === '立即领取') {
                     //if(name.includes(wantName) && $.trim($btn.text()) === '立即领取') {
                        console.log('text',$btn.text(),$btn.html())
                        $btn.click()
                        clearInterval(interval)
                        alert('抢券成功')
                    }
                });
            },5000)
        })
    },3000)

    return false


})();