Skip to content

Commit cee8689

Browse files
committed
dev
1 parent 8c46ca9 commit cee8689

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

WebContent/stat/js/webteam5/spider.html

+18-3
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@
8282
function processGroupSub(data, timestamp, groupId, cb, nextCursor, index) {
8383
console.log("Performing the ", index + 1, "th load in group...");
8484
var url = "http://api.laiwang.com/v1/feed/post/event/list?access_token=" + ACCESS_TOKEN + "&size=20&eventId=" + groupId + "&timestamp=" + timestamp;
85-
if (!nextCursor) {
86-
url += "&nextCursor=" + nextCursor;
85+
if (nextCursor) {
86+
url += "&cursor=" + nextCursor;
8787
}
8888
$.ajax({
8989
type : "get",
@@ -95,13 +95,14 @@
9595
} else {
9696
setTimeout(function() {
9797
processGroupSub(data, timestamp, groupId, cb, o.nextCursor, index + 1);
98-
}, 500);
98+
}, 500 * Math.random());
9999
}
100100
}
101101
});
102102
}
103103

104104
function processDataPool() {
105+
result = [];
105106
console.log("Start processing dataPool...");
106107
var data = dataPool;
107108
var n;
@@ -111,6 +112,8 @@
111112
var resultMap = {};
112113
var c;
113114
var id;
115+
var pc = 0;
116+
var totalMap = {};
114117

115118
console.log("process used map...");
116119
n = usedData.length;
@@ -133,18 +136,24 @@
133136
k = o3.comments.length;
134137
while (k--) {
135138
id = o3.comments[k].commentor.id;
139+
pc++;
140+
totalMap[id] = true;
136141
if (!usedMap[id]) {
137142
resultMap[id] = true;
138143
}
139144
}
140145
k = o3.emotions.length;
141146
while (k--) {
147+
pc++;
142148
id = o3.emotions[k].user.id;
149+
totalMap[id] = true;
143150
if (!usedMap[id]) {
144151
resultMap[id] = true;
145152
}
146153
}
147154
id = o3.publisher.id;
155+
pc++;
156+
totalMap[id] = true;
148157
if (!usedMap[id]) {
149158
resultMap[id] = true;
150159
}
@@ -157,6 +166,12 @@
157166
result.push(key);
158167
}
159168
console.log("Process complete, collected ", result.length, " userIds. Enjoy :), powered by Bosn.");
169+
console.log(pc, " ids processed in total.");
170+
i = 0;
171+
for (key in totalMap) {
172+
i++;
173+
}
174+
console.log('totalMap has ', i, ' items.');
160175
}
161176
</script>
162177
</html>

0 commit comments

Comments
 (0)