Follow the leader | Stalking all accounts that someone else follows using @emrebeyler's Hivemind

avatar


image.png
Hivemind SQL by @emrebeyler. Just queried all accounts that @teamaustralia is following.

Just over a couple of weeks ago, @emrebeyler was kind enough to give me access to his Hivemind database instance. It's basically access to a read-only PostgreSQL database of a Hivemind instance. I had a poke around the tables when I first got my credentials but its taken only until now to find a practical use for it.

If you follow my blog (or have come across my posts), you'll know that I'm from Australia. Fellow Aussie, @ausbitbank, sponsored me through his @centerlink account not long after I joined Steem. Over time, I got to know and follow other Aussies on Steem and I was informed that the @teamaustralia account probably follows all the known Aussies to date. Not too long ago, I snapped up the @teamstraya account as a test curation account with leased Steem Power (a separate post on this later!). What better way to test curation than on my fellow #teamaustralia members? It's currently trailing the @centerlink account.

Now onto the Hivemind! I want @teamstraya to follow all the accounts @teamaustralia is following. I think this query achieves it (please correct me if I'm wrong...and it's probably not the most efficient query either!):

SELECT NAME 
FROM   hive_accounts 
WHERE  id IN (SELECT following 
              FROM   hive_follows 
              WHERE  follower = (SELECT id 
                                 FROM   hive_accounts 
                                 WHERE  NAME = 'teamaustralia')) 

Now for the quick-and-nasty way to follow all the accounts using steem-js:

// ...pg query => populate accounts array


followAccounts( accounts );

var i = 0;
function followAccounts( accounts )
{
  setTimeout( function() {

    var json = JSON.stringify(
      [
        'follow',
        {
          follower: acc,
          following: accounts[i],
          what: [ 'blog' ]
        }
      ]
    );

    Steem.broadcast.customJson( myKey, [], [acc], 'follow', json, function( err, result ) {
      console.log( err, result );
    } );

    i++;
    if( i < accounts.length )
      followAccounts( accounts );

  }, 3000 );
}

The @teamstraya SteemWorld is spammed with Follow Account operations now :P
image.png

And...finished! Mission accomplished!
image.png

Do you have any requests for stats that I could try pulling out from the Hivemind database? Let me know in the comments.

Yours truly,
@contrabourdon





0
0
0.000
15 comments
avatar

Cool use case. It’s possible to bundle multiple follows into just one custom_json op afaik. It might be a little cost effective:)

0
0
0.000
avatar

Thanks! Cool, I'll investigate that for the next account I stalk. I think it ended up costing 5% RCs in total :P

0
0
0.000
avatar

An interesting initiative.

0
0
0.000
avatar

@tipu curate
@giphy curate 100


A huge hug from @amico! 🤗

#sbi-skip !trdo

0
0
0.000
avatar

You have received a 2.51% upvote based on your stake of 2010.01037432 UFM!

0
0
0.000
avatar

!shop
!BEER
for you

0
0
0.000
avatar

你好鸭,contrabourdon!

@eii给您叫了一份外卖!

@cecilian 粥粥 迎着台风 坐着高铁 给您送来
虾条

吃饱了吗?跟我猜拳吧! 石头,剪刀,布~

如果您对我的服务满意,请不要吝啬您的点赞~
@onepagex

0
0
0.000