Skip to content

Commit

Permalink
clean up code/files, make follow_accounts script more configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamCox9 committed Feb 18, 2018
1 parent d47b845 commit ef864ea
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 743 deletions.
27 changes: 22 additions & 5 deletions follow_accounts.js
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);
2 changes: 1 addition & 1 deletion follow_back.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function finishGetFollowers(followers=[]) {
if( config.steem.unfollow_nonfollowers ) {
var toUnfollow = _.difference( followingArray, followersArray );
console.log( 'old followers not following anymore: '+toUnfollow.length );
//library_auth.followAccounts( toUnfollow, [""] );
library_auth.followAccounts( toUnfollow, [""] );
}

//Follow accounts that are now followers but weren't before:
Expand Down
6 changes: 0 additions & 6 deletions misc.js

This file was deleted.

6 changes: 5 additions & 1 deletion publish_post.js → misc_code_snippets.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@
{tags: ['steemjs', 'steem']},
function(err, result) {
console.log(err, result);
});*/
});*/

/*
console.log( steem.auth.getPrivateKeys(username, password, ['owner', 'active', 'posting', 'memo']) );
*/
Loading

0 comments on commit ef864ea

Please sign in to comment.