-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathfollow_back.js
32 lines (25 loc) · 1.1 KB
/
follow_back.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
var config = require('./config');
var library = require('./library');
var library_auth = require('./library_auth');
var _ = require('underscore');
var followingArray = [];
var followersArray = [];
function finishGetFollowers(followers=[]) {
followersArray = followers;
//Unfollow accounts that are no longer followers but were before:
if( config.steem.unfollow_nonfollowers ) {
var toUnfollow = _.difference( followingArray, followersArray );
console.log( 'old followers not following anymore: '+toUnfollow.length );
library_auth.followAccounts( toUnfollow, [""] );
}
//Follow accounts that are now followers but weren't before:
var toFollow = _.difference( followersArray, followingArray );
console.log( 'current followers not following before: '+toFollow.length );
library_auth.followAccounts( toFollow, ["blog"] );
}
function finishGetFollowing(following=[]) {
followingArray = following;
library.getFollowers(config.steem.username,config.steem.start,1000,finishGetFollowers)
}
//Start the chain:
library.getFollowing(config.steem.username,config.steem.start,100,finishGetFollowing);