-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clean up code/files, make follow_accounts script more configurable
- Loading branch information
Showing
5 changed files
with
28 additions
and
743 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,29 @@ | ||
var config = require('./config'); | ||
var library = require('./library'); | ||
var library_auth = require('./library_auth'); | ||
var _ = require('underscore'); | ||
var following = []; | ||
|
||
function startFollowingAccounts(accounts=[]) { | ||
library_auth.followAccounts(accounts,["blog"]); | ||
console.log( 'got # of accounts to follow: '+accounts.length ); | ||
|
||
let to_follow = _.difference( accounts, following ); | ||
|
||
console.log( '# of accounts after removing current following: '+to_follow.length ); | ||
library_auth.followAccounts(to_follow,["blog"]); | ||
} | ||
|
||
function finishGetFollowing(accounts=[]) { | ||
following = accounts; | ||
console.log( 'current # of following: '+following.length ); | ||
|
||
if( config.steem.follow_accounts_from_type == "following" ) | ||
library.getFollowing(config.steem.follow_accounts_from,config.steem.start,100,startFollowingAccounts); | ||
else if( config.steem.follow_accounts_from_type == "followers" ) | ||
library.getFollowers(config.steem.follow_accounts_from,config.steem.start,1000,startFollowingAccounts); | ||
else | ||
startFollowingAccounts( config.steem.accounts_to_follow ); | ||
|
||
} | ||
|
||
if( config.steem.follow_accounts_from !== null ) | ||
library.getFollowing(config.steem.follow_accounts_from,config.steem.start,100,startFollowingAccounts); | ||
else | ||
startFollowingAccounts( config.steem.accounts_to_follow ); | ||
library.getFollowing(config.steem.username,"",100,finishGetFollowing); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.