Coder Social home page Coder Social logo

-bm8-api's Introduction

BM8广州公交实时查询 API
token 算法
$token_string_1 = 'ABCDEFGHIJKLMN'; // 固定值
$token_string_2 = 'ABCDEFGHIJKLMN0123456789'; // 固定值
$token_string_3 = 'k='; // 固定值
public function getToken($token_value, $length = 7)
{
    $token = '';
    for ($i = 0; $i < $length; $i++){
        $a = floor(lcg_value() * strlen($token_value));
        $token .= substr($token_value, $a, 1);
    }
    return $token;
}

获取当前线路车辆情况
{
	"line": "c",
	"id": "3770",
	"token": "KFJDJJG040F782k="
}
参数 类型 释义
line c String 固定值
id String 线路名
token String Token
  • Response
{
    "t": 5, 
    "list": [
        {
	    "i": 0,
	    "bl": 3,
	    "bbl": 0 
	}
    ]
}
Key 类型 释义
t int 正在途中的车辆数
list Array 车辆数据
List内的数据
Key 类型 释义
i int 当前站点序号(0-n)
bl int 正在当前站点的车辆
bbl int 已当前站点已过车辆

获取当前线路 X 站点的车辆情况
{
    "line": "z",
    "id": "333969",
    "token": "GLDLDJI55C5586k="
}
参数 类型 释义
line z String 固定值
id String 当前线路中当前站点的编号
token String Token
  • Response
<button  class="am-btn am-btn-primary">1分 2站<br/>粤A22**7D</button><button  class="am-btn am-btn-primary">23分 13站<br/>粤A06**1D</button><button  class="am-btn am-btn-primary">31分 17站<br/>粤A05**9D</button>

检索线路
{
    "line": "x",
    "id": "78a",
    "token": "MDNHGMIDBDF7K6k="
}
参数 类型 释义
line x String 固定值
id String 线路名
token String Token
  • Response
<ul class="s_l"><li title='天河智慧城核心区(高唐)总站 => 天河北公交总站'><a href='/line/3770.html'>78A线</a></li></ul>

-bm8-api's People

Contributors

william-sv avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.