-
Notifications
You must be signed in to change notification settings - Fork 0
/
shuo.js
executable file
·77 lines (74 loc) · 1.98 KB
/
shuo.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
var queuedo=require("queuedo");
var Douban = require("../lib/index.js");
var formatjson = require('formatjson');
module.exports = function(req, res) {
var config = {
app_key:"0bb4b9fc67f9b013231e2df537ed1039",
app_secret:"e7434521cb0c70ad",
redirect_uri:"http://localhost:8080/sina_auth_cb",
access_token:req.cookies.token
}
var api = new Douban(config);
var datas=[
]
var functions=[
function(callback){
api.shuo.statuses({
source:config.app_key,
text:"hello nodejs"+Math.random()
},function(error,data){
datas.push({
api:"shuo.statuses",
data:formatjson(data)
});
callback();
});
}, function(callback){
api.shuo.home_timeline({},function(error,data){
datas.push({
api:"shuo.home_timeline",
data:formatjson(data)
})
callback();
});
}, function(callback){
api.shuo.user_timeline({
screen_name:"mier963"
},function(error,data){
datas.push({
api:"shuo.user_timeline",
data:formatjson(data)
})
callback();
});
},function(callback){
api.shuo.get({
id:"1033045250"
},function(error,data){
datas.push({
api:"shuo.get",
data:formatjson(data)
})
callback();
});
},function(callback){
api.shuo.del({
id:"1033031694"
},function(error,data){
datas.push({
api:"shuo.del",
data:formatjson(data)
})
callback();
});
}];
queuedo(functions,function(func,next,context){
func(function(){
next.call(context);
});
},function(){
res.render("shuo.html",{
data:datas
})
});
}