2.2.8 • Published 8 years ago

ncu-libary v2.2.8

Weekly downloads
1
License
MIT
Repository
-
Last release
8 years ago

介绍

用于查询图书是否能借阅。一次性查询多本图书,省时省力。 同时设置并发数为5,防止被封禁。

运行方式

npm install ncu-libary --save

将要查找的图书地址,放入一个json文件中即可。

格式如下:

用数组方式,放置网址。或者传入数组

[
  "http://210.35.251.243/opac/item.php?marc_no=0000833661",
  "http://210.35.251.243/opac/item.php?marc_no=0000840261"
]

使用:

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)
})

返回的格式:

[{ 
  // 图书标题
  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
2.2.8

8 years ago

2.2.7

8 years ago

2.2.5

8 years ago

2.3.0

8 years ago

2.2.4

8 years ago

2.2.3

8 years ago

2.2.2

8 years ago

2.2.1

8 years ago

2.2.0

8 years ago

2.1.3

8 years ago

2.1.1

8 years ago

2.1.0

8 years ago

2.0.7

8 years ago

2.0.6

8 years ago

2.0.5

8 years ago

2.0.4

8 years ago

2.0.2

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.2.4

8 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.1.9

8 years ago

0.1.8

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago