I made an upvote bot, and I'm giving it away
It feels good to give back and support people who have influenced my life trough their work.
I really like the Patreon model. It allows people to support their favorite creators with monthly recurring payments.
So I was thinking about how could I apply a recurring model on Steemit?
Automatically upvote, and thus support favorite creators
My first, naive thought was to auto-upvote all the people I'm following, and thus contribute back to them in a way. I had some spare time today, so I wrote a proof of concept script in Python (source code below).
It works pretty well, but...
How can I support my favorite steemit bloggers without relying on upvotes?
These people have been working hard on creating something that contributes to my life, and my $0.001 upvote doesn't feel like a proper way to reciprocate (I'm still a little fish around here).
So why not buy them a coffee every time they publish something new?
# send $2 in SBD
def send_a_tip(author):
steem = Steem(wif=active_key)
steem.transfer(author, 2.0, "SBD", memo="I love your blog. Here is a small gift for you.", account=account)
Full Source Code
from piston.steem import Steem
from piston.steem import BroadcastingError
# my favorite blogs on steemit
top_writers = ["jl777", "xeroc", "dantheman", "pfunk", "arhag", "void", "abit", "jesta"]
# add my favorites
# shoutout to my lil sister @mwpower, she loves to write but gets discouraged fast
my_favorites = ["mwpower"]
my_subscriptions = top_writers + my_favorites
account = "furion"
posting_key = "my_private_posting_key"
active_key = "my_private_active_key"
upvote_history = []
def feed():
print("Waiting for new posts by %s\n" % my_subscriptions)
steem = Steem(wif=posting_key)
for comment in steem.stream_comments():
if comment.author in my_subscriptions:
# Comments don't have titles. This is how we can know if we have a post or a comment.
if len(comment.title) > 0:
# check if we already upvoted this. Sometimes the feed will give duplicates.
if comment.identifier in upvote_history:
continue
print("New post by @%s %s" % (comment.author, url_builder(comment)))
try:
comment.vote(100, account)
print("====> Upvoted")
upvote_history.append(comment.identifier)
except BroadcastingError as e:
print("Upvoting failed...")
print("We have probably reached the upvote rate limit.")
print(str(e))
if comment.author in my_favorites:
send_a_tip(comment.author)
print("====> Sent $2 SBD to @%s" % comment.author)
# send $2 in SBD
def send_a_tip(author):
steem = Steem(wif=active_key)
steem.transfer(author, 2.0, "SBD", memo="I love your blog. Here is a small gift for you.", account=account)
def url_builder(comment):
return "https://steemit.com/%s/%s" % (comment.category, comment.identifier)
if __name__ == "__main__":
while True:
try:
feed()
except (KeyboardInterrupt, SystemExit):
print("Quitting...")
break
except Exception as e:
print("### Exception Occurred: Restarting...")
You will need Python 3 and Piston to run.
python3 upvote_bot.py
Todo
I will be adding an aggregator that sends me an email report containing all the posts I've upvoted, so I can read them before going to bed.
I like the send-tip functionality. Mind if I include this one in bullfrog-system's installation?
The code is license-free so feel free to use it in any way you like.
Awesome. I'll let you know when it's in.
I should probably create a github repo, cleanup the code and add command line flags or config file support.
Totally. If so, I'll add a link to the project page once I add it to the installer.
I really like bullfrog-system. Any way to add upstart support to gain 14.04 LTS support. I would like to mine on my servers, but they are all on 14.04 :(
Thanks!
The main repo will always be strictly 16.04 LTS + fresh install, however, the idea right now is that if anyone wants to fork it and maintain a port for a different distro, I'll link to it from the project page. Similar to how the #steemit team handles the Windows build of steemd. The distro forks will lag behind the main repo a little but that's to be expected.
you can make a video with the bot work?
Great, thank you for sharing this :)
Interesting tòol. Thanks for the contribution .
Does this require steem_cli to be running or does piston run off of something else?
Hi Furion,
Thanks for sharing, do you have a version for your python library or an updated one for piston-lib / piston-cli
I tried the code and got several errors with the new ones.