惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

腾讯CDC
Schneier on Security
Schneier on Security
B
Blog RSS Feed
aimingoo的专栏
aimingoo的专栏
P
Proofpoint News Feed
A
About on SuperTechFans
Recorded Future
Recorded Future
Recent Announcements
Recent Announcements
Microsoft Security Blog
Microsoft Security Blog
L
LangChain Blog
Hugging Face - Blog
Hugging Face - Blog
The GitHub Blog
The GitHub Blog
Google DeepMind News
Google DeepMind News
T
Tailwind CSS Blog
Vercel News
Vercel News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
MyScale Blog
MyScale Blog
V2EX - 技术
V2EX - 技术
N
Netflix TechBlog - Medium
F
Fortinet All Blogs
V
Visual Studio Blog
Martin Fowler
Martin Fowler
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
博客园 - Franky
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
The Exploit Database - CXSecurity.com
F
Full Disclosure
Scott Helme
Scott Helme
H
Heimdal Security Blog
博客园 - 叶小钗
Google DeepMind News
Google DeepMind News
Cyberwarzone
Cyberwarzone
Application and Cybersecurity Blog
Application and Cybersecurity Blog
V
Vulnerabilities – Threatpost
Blog — PlanetScale
Blog — PlanetScale
Security Latest
Security Latest
WordPress大学
WordPress大学
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Troy Hunt's Blog
S
SegmentFault 最新的问题
Forbes - Security
Forbes - Security
Jina AI
Jina AI
S
Securelist
小众软件
小众软件
Simon Willison's Weblog
Simon Willison's Weblog
J
Java Code Geeks
AWS News Blog
AWS News Blog
N
News and Events Feed by Topic
博客园 - 三生石上(FineUI控件)
量子位

龙辉's Blog - 学习笔记

天方云签程序开源 - 龙辉's Blog CTFSHOW-菜狗杯(部分WP) - 龙辉's Blog 贵州师范大学抢课脚本-正方教务系统V8.0.0 - 龙辉's Blog 弱类型与强类型语言“=”号的不同以及引发的安全问题 - 龙辉's Blog php获取客户端ip以及ip伪造 - 龙辉's Blog XSS经典漏洞复现-手撕某非法获取个人信息网站 - 龙辉's Blog php7.2中each()函数被弃用的替换办法 - 龙辉's Blog 云签网站问题反馈贴 - 龙辉's Blog 高三第一次考试总结 - 龙辉's Blog
简单实现每日健康自动打卡 - 龙辉's Blog
博主: Tinker-站长 · 2022-10-10 · via 龙辉's Blog - 学习笔记

简单实现每日健康自动打卡

  • 发布时间:
  • 31178 次浏览
  • 21 条评论
  • 1505字数
  • 分类: php
  1. 首页
  2. 正文  
  3. 分享到:

前言:当代大学生每天必须做的一件事我想会有健康打卡吧,有时候忘记打卡还会被@来@去,于我而言,每天都是在学校,位置并没有变,自动打卡可以完全交给程序去完成啦~以下程序是在贵州师范大学实现,如果是其他学校,方法也差不多噢,接定制~

注意:本脚本仅供学习交流,请勿用于非法操作,建议在下载24小时后删除,由此脚本发生的问题均与本站无关。

本站提供实现原理步骤以及配合腾讯云云函数实现自动签到.

抓包

打卡无非就是向服务器提交某些信息和数据,只要捕获到所需的参数,使用编程模拟向服务器发送数据就可以实现成功打卡。
所以第一步就是抓包。因为打卡是在微信里面打,为了方便,我这里使用的是手机抓包工具 点我下载抓包精灵,按照教程配置好后点击开始,右上角选择抓取微信的,接着打开微信到打卡界面如下打卡
点击打卡后回到抓包软件。搜索daka搜索,找到这一条daka可以看到是向http://daka.wecampus.gznu.edu.cn:80/server/api/baseRecord/add?jwtToken=这里是你的token 提交的post JSON数据,接下来只需要自己用编程语言提交以下数据就可以了。这里我使用比较擅长的PHP.

代码实现

 <?php
    //author 龙辉
   // qq:1790716272
    header("Content-type: text/html; charset=utf-8");
    date_default_timezone_set("PRC");
    $token = '这里替换你的token';//这里填写token=后面的值
    $postdata='{
        "healthStatus":"健康",
        "suspectedDate":null,
        "patientDate":null,
        "isHot":false,
        "temperature":37,
        "isInHospital":"否",
        "hospital":null,
        "isolated":false,
        "isolatedMode":null,
        "isolatedAddress":null,
        "isolatedReason":null,
        "isolatedStartDate":null,
        "isolatedEndDate":null,
        "locationLatitude":"26.38743",
        "locationLongitude":"106.63461",
        "isOut":false,
        "locationCountry":"国内",
        "locationProvince":"贵州省",
        "locationCity":"贵阳市",
        "locationArea":"花溪区",
        "locationDetail":"二号路",
        "hasTravel":false,
        "travelReason":null,
        "travelFromDate":null,
        "travelFromPlace":null,
        "travelArrivalDate":null,
        "travelArrivalPlace":null,
        "travelMode":null,
        "travelComment":null,
        "hasTouchPatient":false,
        "hasOutHistory":false,
        "hasChumHot":false,
        "hasGoHighRiskArea":false,
        "hasTouchPersonFromHighRiskArea":false,
        "notes":"",
        "locationDescription":"贵州省贵阳市花溪区二号路"
    }';
    $result = xCurl('http://daka.wecampus.gznu.edu.cn:80/server/api/baseRecord/add?jwtToken='.$token,'',$postdata);
    if(json_decode($result,true)['success']==true)
    {
        echo '今日健康打卡成功'."\n".'当前时间:'.date('Y-m-d H:i:s', time());
        
    }
    else {
      echo '今日打卡失败,请检查';
    }
    
    function xCurl($url,$cookie=null,$postdata=null,$header=array()){
            $ch = curl_init();
            curl_setopt($ch, CURLOPT_URL,$url);
            if (!is_null($postdata)) curl_setopt($ch, CURLOPT_POSTFIELDS,$postdata);
            if (!is_null($cookie)) curl_setopt($ch, CURLOPT_COOKIE,$cookie);
     curl_setopt($ch, CURLOPT_HTTPHEADER, array(
                'Content-Type: application/json; charset=utf-8',
                'Content-Length:'.strlen($postdata)
            )
     );
            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
            curl_setopt($ch, CURLOPT_ENCODING, "gzip");
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($ch, CURLOPT_TIMEOUT, 2);
            $re = curl_exec($ch);
            curl_close($ch);
            return $re;
        }
    ?>

如果你有服务器或虚拟空间只需要将代码上传并添加计划任务即可.

腾讯云云函数

以下是使用腾讯云云函数实现。
打开腾讯云腾讯云

在搜索框搜索云函数)1THSGSE{82OB7V%O[MA1@M.png,点击新建,选择从头开始,事件函数,运行环境选择php5.6,将上面的代码复制进去,并且把你自己的token填进去D$W8LD)RDZ3RGXB$8O%@KS0.png![][7] 触发方式选择定时触发,触发周期选择自定义,填入0 0 9,14,16 表示在每天上午9点,下午2点,4点触发.然后完成就可以啦~

如果你也懂,就自己写推送吧~我懒 这是我的机器人推送,每天签到完毕会在群里提醒我机器人


版权属于:龙辉博客

本文链接:https://blog.eirds.cn/361.html

如果没有特别声明则为本博原创。转载时须注明出处及本声明!

赞赏作者

如果觉得我的文章对你有用,请随意赞赏

简单实现每日健康自动打卡