diff --git a/Spider.js b/Spider.js index e2698fb..8eeacd0 100644 --- a/Spider.js +++ b/Spider.js @@ -15,7 +15,7 @@ function Spider(userPageUrl, socket) { .then(function(myFriends) { return Promise.map(myFriends, function(myFriend) { return getUser(myFriend.url); - }, { concurrency: 5 }); + }, { concurrency: 3 }); }) .then(function(myFriends) { var input = []; @@ -30,7 +30,7 @@ function Spider(userPageUrl, socket) { console.log(myFriends); return Promise.map(myFriends, function(myFriend) { return searchSameFriend(myFriend, myFriends, socket); - }, { concurrency: 5 }); + }, { concurrency: 3 }); }) .then(function(result) { var data = result; diff --git a/config.js b/config.js index ba7bbc4..15165fe 100644 --- a/config.js +++ b/config.js @@ -1,3 +1,3 @@ module.exports = { - cookie:'_za=c392e6c0-5bdb-4b01-a06d-84ffb9836a61; _ga=GA1.2.378714859.1433690880; _xsrf=44f011b01f29816fc257fae1770a9ece; q_c1=fb660ee5c15b4c97ae2b4b075373e5b6|1457189679000|1433392648000; udid="AIAAQIMSlAmPTohRXib_bmZtsg_JbPW-tC8=|1457502059"; cap_id="OTFiYmZkNjljYjA3NDc5Y2JhNzI1Yjc3YzMxMGZjNmU=|1458100835|fc17d10a2143b6851b98f66b367e7dfb0e16555f"; z_c0="QUFBQTFuTWRBQUFYQUFBQVlRSlZUV2RuRUZlZTh0amgwVjNEaktBVmhZNnNsQXdEa3FqUVVnPT0=|1458100839|d8b64b8c0f8ceb43765d44cb909e0367bcefec0c"; n_c=1; __utmt=1; __utma=51854390.1008998230.1458040825.1458107632.1458110980.7; __utmb=51854390.10.10.1458110980; __utmc=51854390; __utmz=51854390.1458102246.5.3.utmcsr=baidu|utmccn=(organic)|utmcmd=organic; __utmv=51854390.100-1|2=registration_date=20130824=1^3=entry_date=20130824=1', + cookie:'', } \ No newline at end of file diff --git a/fetchFollwerOrFollwee.js b/fetchFollwerOrFollwee.js index 615dcfd..e7890ba 100644 --- a/fetchFollwerOrFollwee.js +++ b/fetchFollwerOrFollwee.js @@ -12,7 +12,7 @@ var fetchFollwerOrFollwee = function(options, socket) { } return Promise.map(offsets, function(offset) { return getFollwerOrFollwee(user, offset, isFollowees, socket); - }, { concurrency: 5 }).then(function(array) { + }, { concurrency: 2 }).then(function(array) { var result = []; array.forEach(function(item) { result = result.concat(item); @@ -41,7 +41,7 @@ function getFollwerOrFollwee(user, offset, isFollowees, socket) { 'cache-control': 'no-cache', 'x-requested-with': 'XMLHttpRequest' }, - timeout: 3000 + timeout: 1500 }, function(err, res, body) { var tmp = []; try {