-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.js
51 lines (34 loc) · 937 Bytes
/
index.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
require('dotenv').config();
//TODO redis err handling, fetch only when started , dry run mode
var pages = require('./common/pages');
function loadPageId() {
}
function loadPageKeys() {
}
//Same as fb
function generatePostKey(pageId, postId){
return [pageId,postId].join('_');
}
function getId(resId){
return resId.split('_')[1];
}
//
//should accept flexible criteria on which posts to search
//e.g. yesterday
//should ignore missed values are are latest posts not yet fetched
//can be avoided by use two sets, but less meaningful as they keep updated
//state of not yet populated?
// return new Promise(function (resolve,reject) {
//
// var isSuccess = bucket.removeTokens(1,function (err) {
// countAndStoreReactions(id)
// })
// isSuccess ? resolve() : reject();
// })
// counting
// need of throttling
// countAndStoreReactions
// pages[SET_KEY]['appledaily.tw']
module.exports = {
// pages:pages,
}