How to find popular people that you may want to follow

in #steemit8 years ago (edited)

How to find popular people that you may want to follow

Last time I published a short post where I explained how to get a list of followers, people that you follow, followers of your followers and the list of people that are followed by the people that you follow.
Sounds complicated enough? Not quite ;-)

@kenny-crane proposed to have a small useful enhancement:

I guess a further step could be to create a list of people
who those you follow are following, and sort it by number
of times they appear in the results, so you can see who
are some popular people that you may want to follow.
You could also find out if you are already following each of these people.

I thought for a while and I decided to use a https://docs.python.org/3/library/collections.html#collections.Counter object to solve it. With just a few lines of code you can check the sets intersection

intersection

and have the result.

Here it goes:

import sys
from collections import Counter
from steemapi.steemnoderpc import SteemNodeRPC

class FollowMe(object):
   def __init__(self):
       self.rpc = SteemNodeRPC("wss://node.steem.ws", "", "", apis=["follow"])

   def following(self, account):
       return [f["following"] for f in self.rpc.get_following(account, "", "blog", 100, api="follow")]


if __name__ == "__main__":
   if len(sys.argv) < 2:
       sys.stderr.write("Usage: %s steem_account" % (sys.argv[0],))
       sys.exit(1)
   f = FollowMe()

   following_counter = Counter()

   for following in f.following(sys.argv[1]):
       print("%s follows %s" % (following, f.following(following)))
       print(60*"-")
       following_counter.update(f.following(following))

   print(following_counter)
   print(60 * "-")
   print(following_counter.most_common(10))

   following = f.following(sys.argv[1])
   most_common_ten = [account[0] for account in following_counter.most_common(10)]
   print("%s should be following %s" % (sys.argv[1], str(set(most_common_ten))))
   print("%s currently follows %s" % (sys.argv[1], str(set(following).intersection(set(most_common_ten)))))

For my account the result was

cryptomental should be following {'anwenbaumeister', 'officialfuzzy', 'roelandp', 'complexring', 'stellabelle', 'riverhead', 'pharesim', 'cass', 'ned', 'clains'}
cryptomental currently follows {'complexring'}

I also tried a few popular accounts like @dollarvigilante

dollarvigilante should be following {'dantheman', 'barrycooper', 'lukewearechange', 'sterlinluxan', 'corbettreport',  'hilarski', 'falkvinge', 'churdtzu', 'larkenrose', 'dragonanarchist'}
dollarvigilante currently follows {'lukewearechange', 'dragonanarchist', 'larkenrose', 'corbettreport', 'falkvinge', 'hilarski', 'dantheman', 'sterlinluxan'}

@dollarvigilante, if you read this you should add 'barrycooper' and 'churdtzu' to your list :D

Next time we can add another heuristics. Have fun with finding best people around!

Sort:  

Coin Marketplace

STEEM 0.17
TRX 0.16
JST 0.028
BTC 73898.71
ETH 2624.92
USDT 1.00
SBD 2.40