机场自动签到
// ==UserScript==
// @name 机场自动签到
// @namespace John
// @version 1.0.0
// @crontab * * once * *
// @author John
// @debug
// @grant GM_notification
// ==/UserScript==
var username = ''
var password = ''
var url = 'https://xn--gmqz83awjh.org'
return new Promise((resolve, reject) => {
GM_xmlhttpRequest({
method: 'POST',
url: url+'/auth/login',
data: 'email=' + encodeURIComponent(username) + '&passwd=' + encodeURIComponent(password) + '&code=',
onload: function (xhr) {
if (xhr.status == 200) {
GM_xmlhttpRequest({
method: 'POST',
url: url+'/user/checkin',
onload: function (xhr) {
GM_notification('✈自动签到成功');
resolve('✈签到完成');
}
});
} else {
GM_notification({
title: '✈自动签到 - ScriptCat',
text: '✈自动签到失败,账号未登录,请先登录',
});
reject('✈账号未登录');
}
}
});
});