def _upvote(self, post, weight): c = SteemComment(comment=post) if not c.is_upvoted_by(self.author): post.upvote(weight=weight, voter=self.author) logger.info( "Upvoted to [{}] [{}] with weight [{:.2f}] successfully". format(post.title, c.get_url(), weight)) return True else: logger.info( "Skip upvote because I already upvoted this post [{}] [{}]". format(post.title, c.get_url())) return False
def what_to_vote(self, ops): # posted_with_steemcn = self.ops.is_app(APP) and not self.ops.is_comment() is_post = not self.ops.is_comment() if is_post: logger.info("Find post {} published with [{}] app".format( self.ops.get_url(), APP)) c = SteemComment(ops=ops) if c.is_upvoted_by(self.by()): logger.info("Post {} is already upvoted. Skip.".format( c.get_url())) return False else: return True return False
def vote(self, post=None, url=None): c = SteemComment(comment=post, url=url) receiver = c.get_comment().author title = c.get_comment().title if not c.is_upvoted_by(self.author): self.voter.upvote(c.get_comment(), weight=float(VOTE_WEIGHT)) logger.info("I have upvoted @{}'s post [{}] successfully".format( receiver, title)) return True else: logger.info( "Skip upvote @{} because I already upvoted his/her post [{}]". format(receiver, title)) return False
def what_to_vote(self, ops): posted_with_steemcn = self.ops.is_app( APP) and not self.ops.is_comment() if posted_with_steemcn: logger.info("Find post {} published with [{}] app".format( self.ops.get_url(), APP)) c = SteemComment(ops=ops) beneficiary = c.get_beneficiaries(account=BENEFICIARY_ACCOUNT) if beneficiary >= BENEFICIARY_THRESHOLD: logger.info("Post {} has set {} beneficiary.".format( self.ops.get_url(), beneficiary)) if c.is_upvoted_by(self.by()): logger.info("Post {} is already upvoted. Skip.".format( c.get_url())) return False else: return True return False