Home > Web Front-end > JS Tutorial > body text

How to implement webpage grabbing red envelopes in Javascript

亚连
Release: 2018-06-12 15:12:48
Original
3561 people have browsed it

This article describes the principles and ideas of Javascript writing through an example of a web page for grabbing red envelopes. Interested friends can refer to it for reference.

At first, I used Firefox to add the Firebug/YSlow plug-in for analysis, but Firefox could not run custom javascript, and it seemed that I needed to install some plug-ins. So I switched to chrome and found that chrome is pretty good. You can just write javascript and install it as a plug-in.

Taobao also changed the script several times, but of course it was the same every time. I admire the hard-working Taobao programmers who have to work overtime on weekends to revise scripts.

The appendix is ​​a version of the script I wrote. Directly calling

Volcano.BrickRate=1.0;
Volcano.Brick.getLottery(KISSY);
Copy after login

KISSY is something similar to JQuery. It took me a long time to figure it out.

After hanging up for 2 days, I only won 50 yuan in total. It is said that the big prizes are all leaked, you know. If Taobao only distributes rewards based on accounts, plug-in scripts are useless, haha.

Second version of script.

// tmall scripts in Chrome 
//
//
// ==UserScript==
// @name   tmall
// @namespace  google
// @author  vesor
// @description Simple userscript to grasp tmall lottery
// @include  http://www.tmall.com
Volcano.BrickRate=1.0;
Volcano.Brick.getLottery(KISSY);
//var L = S.DOM.get("#J_Lucky");
//L.click();
if(++tryCount)
setTimeout(loopWrapper, 100);
}
 loopWrapper();
console.log("tmall.user.js: Loaded");
}
} catch(e) {
console.log("Failed loading tmall.user.js");
}
Copy after login

The above is what I compiled for everyone. I hope it will be helpful to everyone in the future.

Related articles:

How to implement WebSocket function using NodeJS

How to obtain node elements using JS

Add element new node using JS

About the use of vue-fontawesome in vue.js

The above is the detailed content of How to implement webpage grabbing red envelopes in Javascript. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template