-
Notifications
You must be signed in to change notification settings - Fork 0
/
followers.py
30 lines (22 loc) · 1.03 KB
/
followers.py
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
import sys
from steemapi.steemnoderpc import SteemNodeRPC
class FollowMe(object):
def __init__(self):
self.rpc = SteemNodeRPC("wss://node.steem.ws", "", "", apis=["follow"])
def followers(self, account):
return [ f["follower"] for f in self.rpc.get_followers(account, "", "blog", 100, api="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()
print("%s followers %s" % (sys.argv[1], f.followers(sys.argv[1])))
print("%s follows %s" % (sys.argv[1], f.following(sys.argv[1])))
for follower in f.followers(sys.argv[1]):
print("%s is followed by %s" % (follower, f.followers(follower)))
print(60*"-")
for following in f.following(sys.argv[1]):
print("%s follows %s" % (following, f.following(following)))
print(60*"-")