diff --git a/setup.py b/setup.py index 7f21a3e..d1fbf8f 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='steem_tagbot', - version='0.0.8', + version='0.0.9', packages=["tagbot",], url='http://github.com/emre/tagbot', license='MIT', @@ -14,5 +14,5 @@ 'tagbot = tagbot.bot:main', ], }, - install_requires=["steem_dshot", "nltk"] + install_requires=["steem_dshot", "nltk", "requests"] ) diff --git a/tagbot/bot.py b/tagbot/bot.py index eed4da3..5b97e90 100644 --- a/tagbot/bot.py +++ b/tagbot/bot.py @@ -9,6 +9,7 @@ from steem.account import Account from steem.post import Post from steem.amount import Amount +import requests from tagbot.utils import get_steem_conn, get_current_vp, url, reputation, tokenize @@ -116,6 +117,11 @@ def fetch_tag(self, tag, start_author=None, start_permlink=None, posts=None, sca scanned_pages=scanned_pages + 1, ) + def in_global_blacklist(self, author): + url = "http://blacklist.usesteem.com/user/" + author + response = requests.get(url).json() + return bool(len(response["blacklisted"])) + def start_voting_round(self): posts = [] for tag in self.target_tags: @@ -204,6 +210,13 @@ def start_voting_round(self): ) continue + if self.in_global_blacklist(post.get("author")): + logger.info( + "Post: %s is skipped since it's blacklisted globally.", + post.identifier + ) + continue + self.upvote( Post(post, steemd_instance=self.steemd_instance), self.config["VOTE_WEIGHT"]