Advertisement
Guest User

Untitled

a guest
Jan 18th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. from steem import Steem
  2. from steem.blockchain import Blockchain
  3. from steem.post import Post
  4. import datetime
  5.  
  6. voting_trail = ["amosbastian", "juliank"]
  7. template = "@{}/{}"
  8.  
  9. steem = Steem()
  10. blockchain = Blockchain()
  11. stream = blockchain.stream(filter_by=["vote"])
  12.  
  13. if __name__ == '__main__':
  14. while True:
  15. try:
  16. for vote in stream:
  17. voter = vote["voter"]
  18. author = vote["author"]
  19. permlink = vote["permlink"]
  20.  
  21. if voter in voting_trail:
  22. post = template.format(author, permlink)
  23. if Post(post).is_main_post() and Post(post).time_elapse() > datetime.timedelta(minutes=30) :
  24. print("Voting on {} post that {} voted on!".format(
  25. permlink, voter))
  26. steem.vote(post, 100)
  27. except Exception as error:
  28. print(repr(error))
  29. continue
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement