北京地铁某站点自动预约入站源码php

因之前在沙河住着,但是每天上班进地铁要排队,然而地铁有预约功能,但是根本就抢不到,估计沙河居住的IT大佬有点多,都是高科技预约的,所以就研究了一下,挂在软件上可设置定时自动预约。 目前支持预约站点:

直接上图:
登录地址:https://webui.mybti.cn/#/login?clientid=e8725b01-c216-4e29-92a5-f2d1d2343fdc
获取authorization 参数教程:

我是用易语言写了个定时自动预约工具,大家可参考以下预约代码,自行搞定时预约。。。

代码语言:javascript
复制
<?php
error_reporting(0);
header('Content-type: text/json;charset=utf-8');

//预约地址:https://webui.mybti.cn/#/login?clientid=e8725b01-c216-4e29-92a5-f2d1d2343fdc

//authorization 参数
authorization = _GET['url'];
//时间点如:0740 - 0750
time = _GET['time'];
if(empty($time)){
$time = "0740-0750";
}
//下面是站点配置信息,
array=&#39;{&#34;lineName&#34;:&#34;昌平线&#34;,&#34;snapshotWeekOffset&#34;:0,&#34;stationName&#34;:&#34;沙河站&#34;,&#34;enterDate&#34;:&#34;&#39;.date(&#34;Ymd&#34;,strtotime(&#39;+1 day&#39;)).&#39;&#34;,&#34;snapshotTimeSlot&#34;:&#34;0630-0930&#34;,&#34;timeSlot&#34;:&#34;&#39;.time.'"}';

if(empty($authorization)){
$authorization = "MzllNWQ4OWUtODY1MS00MjliLTljOTktODhjOTMxOTFlMmQ1LDE2NjE4Mzc3ODU4OTQsUFE2OUp6RXBa6RCtKS2ZsiUXk2N1NiYlpxYUdFPQ==";
}

echo get_curl("https://webapi.mybti.cn/Appointment/CreateAppointment",array,authorization);
function get_curl(url,post=0,authorization=0,referer=0,cookie=0,header=0,ua=0,nobaody=0,$randip=0){

            $ch = curl_init();
            curl_setopt($ch, CURLOPT_URL,$url);
            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
            curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);

    $httpheader[] = &#34;accept: application/json, text/plain, */*&#34;;
    $httpheader[] = &#34;accept-encoding: gzip, deflate, br&#34;;
    $httpheader[] = &#34;accept-language: zh-CN,zh;q=0.9&#34;;
    $httpheader[] = &#34;authorization: $authorization&#34;;
    $httpheader[] = &#34;content-length: 150&#34;;
    $httpheader[] = &#34;content-type: application/json;charset=UTF-8&#34;;
    $httpheader[] = &#34;origin: https://webui.mybti.cn&#34;;
    $httpheader[] = &#34;referer: https://webui.mybti.cn/&#34;;
    $httpheader[] = &#34;user-agent: Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1&#34;;

            curl_setopt($ch, CURLOPT_HTTPHEADER, $httpheader);
            if($post){
                    curl_setopt($ch, CURLOPT_POST, 1);
                    curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
            }
            if($header){
                    curl_setopt($ch, CURLOPT_HEADER, TRUE);
            }
            if($cookie){
                    curl_setopt($ch, CURLOPT_COOKIE, $cookie);
            }
            if($referer){
                    curl_setopt($ch, CURLOPT_REFERER, $referer);
            }
            if($ua){
                    curl_setopt($ch, CURLOPT_USERAGENT,$ua);
            }else{
                    curl_setopt($ch, CURLOPT_USERAGENT,&#39;Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.152 Safari/537.36&#39;);
            }
            if($nobaody){
                    curl_setopt($ch, CURLOPT_NOBODY,1);

            }
            curl_setopt($ch, CURLOPT_TIMEOUT, 20);
            curl_setopt($ch, CURLOPT_ENCODING, &#34;gzip&#34;);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
            $ret = curl_exec($ch);
            curl_close($ch);
            return $ret;
    }

?>