(Python)四川移动大转盘自动抽奖脚本

每天都可以抽奖,对于不缺流量的我来说,也只是屯在这儿,等我联通卡没有网络的时候用用。需要使用的友友可自行登录 “四川掌上营业厅” 抓包获取 “SSOCookie”,然后挂到腾讯的云函数,可设置触发方式为每天凌晨,可配合server酱,将抽奖情况推送到微信,简直不能太香
代码放下边了

# -*- coding: utf8 -*-
import requests
import json
from urllib.parse import quote
import time
###设置server酱的sckey    server酱官网:http://sc.ftqq.com
SSOCookie=''
sckey = ""
def qd():
    url = "https://wap.sc.10086.cn/scmccCampaign/newturntable/dzpDraw.do"
    body = {'SSOCookie': '' + SSOCookie, 'canals': 'zt1'}
    response = requests.post(url, body)
    print(response.text)
    ##通过json处理数据 变成dict
    data = json.loads(response.text)
    if data["result"]["info"] == "谢谢参与!":
        print("四川移动大转盘_自动抽奖成功——谢谢参与!")
        ##发送签到信息到server酱
        requests.get('https://sc.ftqq.com/' + sckey + '.send?text=' + quote(
            '四川移动大转盘_自动抽奖成功——谢谢参与!' + time.strftime('%Y.%m.%d', time.localtime(time.time()))))
    elif data["result"]["info"] == "恭喜中奖!":
        print("四川移动大转盘_自动抽奖成功——恭喜中奖!")
        ##发送签到信息到server酱
        requests.get('https://sc.ftqq.com/' + sckey + '.send?text=' + quote(
            '四川移动大转盘_自动抽奖成功——恭喜中奖!' + time.strftime('%Y.%m.%d', time.localtime(time.time()))))
    elif data["result"]["info"]=="次数已经用完,请明天再试":
        print("四川移动大转盘_今日已自动抽奖,次数已经用完,请明天再试")
        ##发送签到信息到server酱
        requests.get('https://sc.ftqq.com/' + sckey + '.send?text=' + quote(
            '四川移动大转盘_今日已抽奖,次数已经用完,请明天再试!' + time.strftime('%Y.%m.%d', time.localtime(time.time()))))
    else:
        print("四川移动大转盘_自动抽奖失败")
        ##发送签到信息到server酱
        requests.get('https://sc.ftqq.com/' + sckey + '.send?text=' + quote(
            '四川移动大转盘_自动抽奖失败' + time.strftime('%Y.%m.%d', time.localtime(time.time()))))

# {"result":{"obj":{"canals":"zt1","prize":"200M国内流量","f_code":null,"si":"0"},"code":0,"info":"恭喜中奖!"}}——2020年03月05日 12时35分39秒
# {"result":{"obj":{"f_date":"20200308","f_send_status":"7","f_phone":"182","f_channel":"","f_prize_name":"谢谢参与","f_prize_id":"99","f_canals":"zt1","f_todayChar6":"202003","si":"99"},"code":7,"info":"谢谢参与!"}}
# {"result":{"obj":{"f_date":"20200309","f_phone":"182","f_channel":"","f_canals":"zt1","f_todayChar6":"202003"},"code":4,"info":"次数已经用完,请明天再试"}}
def main_handler(event, context):
    return qd()
# Python  

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×