Advertisement
wil1liam

list-of-voter

Feb 2nd, 2018
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.69 KB | None | 0 0
  1. from steem import Steem
  2.  
  3. s = Steem(["https://api.steemit.com"])
  4.  
  5. def get_voter(post_identifier):
  6.     post_identifier = post_identifier.split("/")
  7.     votes = s.get_active_votes(post_identifier[0],post_identifier[1])
  8.     voter = []
  9.     for i in votes:
  10.         if (i["voter"] != post_identifier[0]):
  11.             voter.append(i["voter"])
  12.     return voter
  13.  
  14. def get_newest_post(username):
  15.     newest_post = s.get_discussions_by_blog({"limit":1,"tag":username})
  16.     if(newest_post!=[]):
  17.         return newest_post[0]["author"]+"/"+newest_post[0]["permlink"]
  18.     else:
  19.         return None
  20.  
  21. username = "wil1liam"
  22. post_identifier = get_newest_post(username)
  23.  
  24. print(get_voter(post_identifier))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement