Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lsongdev/node-12306
:bullettrain_side: 12306 JavaScript client
https://github.com/lsongdev/node-12306
12306 12306buyticket networking train
Last synced: 3 days ago
JSON representation
:bullettrain_side: 12306 JavaScript client
- Host: GitHub
- URL: https://github.com/lsongdev/node-12306
- Owner: lsongdev
- License: mit
- Created: 2019-01-18T11:01:06.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-06-26T03:56:09.000Z (6 months ago)
- Last Synced: 2024-12-31T10:05:31.219Z (5 days ago)
- Topics: 12306, 12306buyticket, networking, train
- Language: JavaScript
- Homepage: https://npmjs.org/node-12306
- Size: 56.6 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## 12306 [![t12306](https://img.shields.io/npm/v/t12306.svg)](https://npmjs.org/t12306)
> 12306 javascript client
### Installation
```bash
$ npm install t12306
```### Example
```js
const T12306 = require('t12306');const train = T12306();
(async () => {
const list = await train.query('BJP', 'SHH', '2019-12-28');
const img = await train.captcha_image();
const pos = await train.captcha_recognize(img);
const res = await train.captcha_check(pos);
const uamtk = await train.login('admin', 'admin', pos);
const newapptk = await train.auth_uamtk(uamtk);
const { username, apptk } = await train.uamauthclient(newapptk);
const passengers = await train.getPassengerDTOs();})();
```### Contributing
- Fork this Repo first
- Clone your Repo
- Install dependencies by `$ npm install`
- Checkout a feature branch
- Feel free to add your features
- Make sure your features are fully tested
- Publish your local branch, Open a pull request
- Enjoy hacking <3### MIT
This work is licensed under the [MIT license](./LICENSE).
---