forked from liuyong5653/NCrawler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
36 lines (32 loc) · 921 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/**
* 数据抓取demo
*
* NCrawler
* Created by Jacky.L on 1/7/15.
* Copyright (c) 2014 ZLYCare. All rights reserved.
*/
var
Hospital = require('./app/controllers/HospitalController'),
Doctor = require('./app/controllers/DoctorController');
console.log("测试fork-pull合并代码");
//Demo: 查询并存储北京所有的医院
//Hospital.getHospitalListByProvince()
// .then(function(data){
// console.log("Finish get data.");
// return Hospital.parseAndStore(data);
// })
// .then(function(){
// console.log("Finish parse and store data.");
// },function(err){
// console.log("oooo:" + err);
// });
Doctor.getDoctorListByDepartmentId(125)
.then(function (data) {
console.log("Finish get data.");
return Doctor.parseAndStore(data,125);
})
.then(function () {
console.log("Finish parse and store data.");
}, function (err) {
console.log("oooo:" + err);
});