Greasy Fork

来自缓存

美团叠加券

美团叠加券,指定名称wantName 可以抢券

当前为 2024-03-21 提交的版本,查看 最新版本

// ==UserScript==
// @name         美团叠加券
// @namespace    http://tampermonkey.net/
// @version      1.0.0
// @description  美团叠加券,指定名称wantName 可以抢券
// @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';
    const wantName = '东北饺子馆(张江店)'
    const dianName = []
    let oldlength = 0
    const interval = setInterval(function(){
        $("html, body").animate({ scrollTop: $(document).height() });
        //if($('.mb16').length === oldlength){
            // clearInterval(interval)
            $.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()) === '立即领取') {
                    console.log('text',$btn.text(),$btn.html())
                    $btn.click()
                    clearInterval(interval)
                }
            });
        //} else {
            // oldlength = ('.mb16').length
        // }
    },2000)
})();