Last active
August 28, 2020 02:27
-
-
Save latel/99e2d62b210711941af7cb670070b716 to your computer and use it in GitHub Desktop.
抢futu美股现金种子和股票卡
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let scriptLoaded = 0; | |
let scriptDayjs = document.createElement('script'); | |
scriptDayjs.src = | |
'https://cdnjs.cloudflare.com/ajax/libs/dayjs/1.8.16/dayjs.min.js'; | |
let scriptJQuery = document.createElement('script'); | |
scriptJQuery.src = 'https://libs.baidu.com/jquery/2.0.0/jquery.min.js'; | |
let csrf = document.querySelector('meta[name="csrf-token"]').content; | |
let uid = document.cookie.match(/uid=(\d+)/)[1]; | |
let ticker = 0; | |
let limit = 1; | |
let interval = 10; | |
let timer = setInterval(() => { | |
++ticker; | |
if (scriptLoaded === 2) { | |
console.info('依赖脚本全部加载成功'); | |
scriptLoaded++; | |
} | |
if (scriptLoaded > 2) { | |
let beginTime = dayjs() | |
.set('h', 10) | |
.set('m', 0) | |
.set('s', 0); | |
let startTime = beginTime.subtract(1, 's'); | |
let endTime = beginTime.add(1, 's'); | |
let now = dayjs(); | |
if (ticker % (1000 / interval) === 0) { | |
const [minites, decimalSec] = (beginTime.diff(now) / 1000 / 60).toFixed(3).split('.'); | |
const seconds = Math.floor(60*decimalSec/999); | |
console.warn( | |
`还有${minites}分${seconds}秒即将开始` | |
); | |
} | |
if (now.isAfter(startTime)) { | |
if (now.isAfter(endTime)) { | |
console.log('已结束'); | |
return clearInterval(timer); | |
} | |
console.info('抢啊!!!'); | |
$.post( | |
'https://company.futu5.com/api/employee-space/claim-limit-time-prize', | |
{ | |
uid: uid, | |
type: 3, | |
start_time: beginTime.toDate().getTime() / 1000, | |
_csrf: csrf, | |
} | |
); | |
$.post( | |
'https://company.futu5.com/api/employee-space/claim-limit-time-prize', | |
{ | |
uid: uid, | |
type: 2, | |
start_time: beginTime.toDate().getTime() / 1000, | |
_csrf: csrf, | |
} | |
); | |
} | |
} | |
}, interval); | |
scriptDayjs.onload = () => ++scriptLoaded; | |
scriptJQuery.onload = () => ++scriptLoaded; | |
document.body.appendChild(scriptDayjs); | |
document.body.appendChild(scriptJQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment