lpessin avatar

Upper! Steem bot

lpessin

Published: 11 Jul 2019 › Updated: 11 Jul 2019Upper! Steem bot

Upper! Steem bot

Upper

reads every new comment made by authors in a list and searches for the flag(!command) who will trigger actions on the main post(e.g. upvote, comment, and resteem)

Repository: https://github.com/lpessin/upper

Introduction

A steemian friend asks me to help him with his project, a curation project with several curators reading and approving posts. He needs to automate tasks (upvote, comment, and resteem). As it may be useful to others I decided to open source and post it.

Upper is a simple python script following basic instructions from the steem-python official library, plus a few things I've added.

I'm posting as a blog contribution, and not development because this is more a 'learning-process/help-friend' thing than an actual project claiming this is 100% my creation, I just put some pieces together and tested my skills.

Next, you'll see how to install, the usage, and its features.


You will need

  • Python 3.6+
  • Steem-Python
  • Regex
  • Linux (Ubuntu)

Install
Always best to create a venv or use ide like pycharm

Installing steem-python and regex:

pip3 install regex
pip3 install steem

Clone repository:

git clone https://github.com/lpessin/upper.git

Setup & usage

Open curators file, and add accounts you wish to search for comments with the flag(!command):

lpessin
acc2
acc3
...

Now edit upper.py to set-up the worker account:

acc = 'your_account' 
s = Steem(keys='your_posting_key')

w = 100.0 # set the vote weight you want

Choose your flag (!up as default):

# Set here your flag command without the '!'        
flag = 'up'   

Write the comment you want to post (markdown supported):

comment = str(f'Congrats, @{a_action}!\nYour post received an Upper from @{c_action}!')

'{a_action}' is the main post author, and '{c_action}' is the curator

And finally, run:

python3 upper.py

Now whenever a listed curator types '!up'(or the flag you chose) inside a comment, your account will upvote, comment and resteem the main post where the comment was made. Cool!


Outputs:
image.png

image.png
image.png



Highlights:

  • flag(!command) is spotted at any part of the comment and alongside with any other words in the comment body
  • A log file with date and time who keeps all past data (you can exit, run again and will never lose track)
  • Handles multiples action threads in parallel with the stream (you won't miss a post)
  • Will never perform the same actions on the same main post

I hope to keep improving the code and any contributions, suggestions and/or questions are welcome.
Thanks, goodbye!

Leave Upper! Steem bot to:

Written by

Imagination will often carry us to worlds that never were. But without it we go nowhere.

Read more #utopian-io posts


Best Posts From lpessin

We have not curated any of lpessin's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From lpessin