steemrewarding.com - tables improved (links and sortable) and more options for trail vote rules

rewarding_batch2.png

Repository

https://github.com/holgern/steemrewarding

steemrewarding.com is a feature-rich automatic voting tool. It can be used to create voting rules at https://steemrewarding.com, when posting authority was given to the @rewarding account. I created a discord server for all topics regarding steemrewarding.com: discord invitation.

steemrewarding is currently used by 109 users which created 945 rules for posts, 70 rules for comments and 19 trail vote rules. In the last 7 days were 4381 time based votes and 865 vp based votes broadcasted through steemrewarding.

Improved table layout which is now partly sortable

image.png
The header are now links when the column is sortable. When clicking on it, it calls the same site with a sort and a directionparameter:

1
https://steemrewarding.com/show_vote_log?sort=author&direction=asc

These parameter are parsed:

1
2
sort = request.args.get('sort', 'timestamp')
reverse = (request.args.get('direction', 'desc') == 'desc')

and the array is sorted:

1
2
3
4
try:
sorted_log = sorted(logs, key=lambda x: x[sort] or 0, reverse=reverse)
except:
sorted_log = logs

The try/except prevent a crash when a wrong sort parameter was given.

The header links are created by implementing a sort_url function in the Table class:

1
2
3
4
5
6
7
8
9
10
class VotesLog(Table):
...
...
allow_sort = True
def sort_url(self, col_key, reverse=False):
if col_key in ["authorperm", "author", "vote_weight", "vote_delay_min", "voted_after_min"]:
direction = 'asc'
else:
direction = 'desc'
return url_for('show_vote_log', sort=col_key, direction=direction)

A new class was defined:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
class ExternalURLCol(Col):
def __init__(self, name, url_attr, **kwargs):
self.url_attr = url_attr
super(ExternalURLCol, self).__init__(name, **kwargs)

def td_contents(self, item, attr_list):
text = self.from_attr_list(item, attr_list)
url = self.from_attr_list(item, [self.url_attr])
return element('a', {'href': 'https://steemit.com/' + url, 'target': "_blank", 'class': 'table'}, content=text)

class ExternalAuthorURLCol(Col):
def __init__(self, name, url_attr, **kwargs):
self.url_attr = url_attr
super(ExternalAuthorURLCol, self).__init__(name, **kwargs)

def td_contents(self, item, attr_list):
text = self.from_attr_list(item, attr_list)
url = self.from_attr_list(item, [self.url_attr])
return element('a', {'href': 'https://steemit.com/@' + url, 'target': "_blank", 'class': 'table'}, content=text)

That can be used to create a field in the table by:

1
author = ExternalAuthorURLCol('author', url_attr='author', attr='author', allow_sort = True)

vote_when_vp_reached added to trail vote rules

image.png
It is now possible to vote posts that were upvoted by a certain voter, when the vote power reaches a defined percentage. A trail vote rule with enabled vote_when_vp_reached will create a pending vote, when the voter to follow upvotes something. This new created pending vote has a min_vp and an enabled vote_when_vp_reached, which will keep the vote in a pending state until the vote power is suffient high or maximum_vote_delay_min is reached.

exclude all authors that have an enabled vote rule

It is possible to exclude all authors that have an enabled vote rule when following a vote trail.
image.png
When the followed voter upvotes a main post, it is checked if a vote rule for a main post from the author exists. When the followed voter upvotes a comment, it is checked if a vote rule for a comment from the author exists. When a rule exists, the post/comment is skipped.

maximum_vote_delay_min was added as parameter for a vote rule

It is possible to define the maximum post/comment age. When defined, posts/comments are only upvoted when their age is younger than the defined one. The value is the maximum age in minutes.

Commits

add option exclude_authors_with_vote_rule that exclude authors that have an enabled rule for trail votes

  • commit 5352b0e

    sql database improved, vote_sbd fixed and new parameter added

  • commit ba4b6a0

    Use BoolCol for boolean and add sortable tables to vote rules and trail vote rules

  • commit c660046
  • commit 69d74d0

    add vote_when_vp_reached and vp_reached_order to trail vote rules

  • commit 55c833b

    add maximum_vote_delay_min and add some more checks

  • commit d7201f1
  • max_votes_per_day and max_votes_per_week is fixed
  • get_account added in trail_vote_rule_storage.py
  • get_voter added in vote_rule_storage.py

GitHub Account

https://github.com/holgern