Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lxxyx/ncu-libary
NCU Libary Helper
https://github.com/lxxyx/ncu-libary
Last synced: about 1 month ago
JSON representation
NCU Libary Helper
- Host: GitHub
- URL: https://github.com/lxxyx/ncu-libary
- Owner: Lxxyx
- Created: 2016-03-14T12:35:18.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-08-14T14:36:55.000Z (over 8 years ago)
- Last Synced: 2024-12-15T09:37:45.083Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 75.2 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## 南昌大学图书馆插件
![build status](https://api.travis-ci.org/Lxxyx/ncu-libary.svg?branch=master) [![codecov](https://codecov.io/gh/Lxxyx/ncu-libary/branch/master/graph/badge.svg)](https://codecov.io/gh/Lxxyx/ncu-libary) ![total-download](https://img.shields.io/npm/dt/ncu-libary.svg?maxAge=2592000) ![node-version](https://img.shields.io/npm/v/ncu-libary.svg?maxAge=2592000) ![license](https://img.shields.io/github/license/mashape/apistatus.svg?maxAge=2592000)
## 介绍
用于查询图书是否能借阅。一次性查询多本图书,省时省力。
同时设置并发数为5,防止被封禁。
## 运行方式
```javascript
npm install ncu-libary --save
```将要查找的图书地址,放入一个json文件中即可。
### 格式如下:
用数组方式,放置网址。或者传入数组
```javascript
[
"http://210.35.251.243/opac/item.php?marc_no=0000833661",
"http://210.35.251.243/opac/item.php?marc_no=0000840261"
]
```
## 使用:
```javascript
var lib = require('ncu-libary')
// 函数内填数组,如:
var list = [
"http://210.35.251.243/opac/item.php?marc_no=0000833661",
"http://210.35.251.243/opac/item.php?marc_no=0000840261"
]
lib.booksInfo(list)
.then(data => {
// 对获取到的图书数据进行操作
})
.catch(err => {
// 错误处理
})// 查询用户借阅书籍
lib.lend(username, password = '123456')
.then(data => console.log(data))// 查询书籍,默认只能查询前湖校区的图书
lib.search(bookname, page = 1)
.then(data => {
console.log(data)
})// 续借
lib.relend(uri)
.then(data => console.log(data)
.catch(err => console.log(err)
```### 返回的格式:
```javascript
[{
// 图书标题
title: '《图解CSS3核心技术与案例实战》',
// 图书在流通书库的位置
location: 'TP393.092.2/143 ',
// 图书的可借阅数量
canBorrowNum: 0
}]
```
## 开发
```
git clone https://github.com/Lxxyx/ncu-libary
cd ncu-libary
npm install
gulp
```
### 测试
全局安装mocha
```
npm i mocha -g
```
然后:
```
npm test
```