Skip to content

Instantly share code, notes, and snippets.

@typcn
Last active February 1, 2017 18:36
Show Gist options
  • Save typcn/f6b28aba0d1ea512b2168b91056a26fe to your computer and use it in GitHub Desktop.
Save typcn/f6b28aba0d1ea512b2168b91056a26fe to your computer and use it in GitHub Desktop.
umetrip_auto_sign
const tpush = require('typcnpush-sdk');
const http = require('http');
tpush.useInternalMode();
setInterval(function(){
let options = {
host: 'ume1.umetrip.com',
port: 80,
path: '/UmeAd/everyday/luck.do?sid=YOUR_SESSION_ID',
method: 'GET'
};
callback = function(response) {
let str = ''
response.on('data', function (chunk) {
str += chunk;
});
response.on('end', function () {
let s = parseInt(str.toString());
if(s == 0){
console.log('签到失败');
}else if(s < 5){
console.log('签到成功,获得旅豆');
}else{
tpush.pushToDevice('iOS','a2cc2d4030ae0784da1902e7f972eb5acd6604dbe96db901161759a7ca81','航旅纵横自动抽奖','抽到实物奖品,请登录查看');
console.log('签到成功,获得大奖');
}
});
}
http.request(options, callback).end();
},1000*3600*24);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment