This is the basic build of the Prosper bot which will work as an upvoter and curator. The goal of this bot is to help selected minnows with good content.
Here is the first code for the beginning of the bot.py file. This currently allows the bot to upvote based on a list in the votelist.txt file. This file will be populated with lesser-known quality content creators.
from steem.steem import Steem
from steem.steem import BroadcastingError
import threading
import time
import random
import csv
my_subscriptions = []
with open('votelist.txt', mode='r') as infile:
reader = csv.reader(infile)
for rows in reader:
v = rows[0]
my_subscriptions.append(v)
account = ["account_goes_here"]
posting_key = ["password_goes_here"]
vote_delay = random.randrange(1200,1800)
upvote_history = []
def feed():
print("Waiting for new posts by %s\n\n\nGo Oprah!\nGo Winfrey!" % my_subscriptions)
steem = Steem(wif=posting_key[0])
for comment in steem.stream_comments():
if comment.author in my_subscriptions:
if len(comment.title) > 0:
if comment.identifier in upvote_history:
continue
print("New post by @%s %s" % (comment.author, url_builder(comment)))
workerThread = threading.Thread(name=comment.identifier, target=worker, args=(comment,))
workerThread.start()
def url_builder(comment):
return "https://steemit.com/%s/%s" % (comment.category, comment.identifier)
def worker(worker_comment):
time.sleep(vote_delay)
try:
for (k,v) in enumerate(account):
worker_steem = Steem(wif=posting_key[k])
upvote_comment = worker_steem.get_content(worker_comment.identifier)
# vote weight 100 full power vote -100 full power flag
upvote_comment.vote(100, v)
print("@%s====> ^Upvoted^" % upvote_comment.author)
upvote_history.append(upvote_comment.identifier)
except BroadcastingError as e:
print("@%s<- failed" % upvote_comment.author)
print(str(e))
if __name__ == "__main__":
while True:
try:
feed()
except (KeyboardInterrupt, SystemExit):
print("Quitting...")
break
except Exception as e:
traceback.print_exc()
print("### Exception Occurred: Restarting...")
More features will be added very soon. This is very basic for now.
Commit URL: https://github.com/nolyoly/prosper-ai/commit/f57a735c36717c23bb571899646bc71b6e99029b
Posted on Utopian.io - Rewarding Open Source Contributors
Your contribution can't be approved yet. See the Utopian rules. You need to give the link to the commits or PR or a link to the project in case it is yours. And remove steemit tag.
You can contact us on Discord.
[utopian-moderator]
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
done.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Approved.
[utopian-moderator]
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
@ering has voted on behalf of @minnowpond.
If you would like to recieve upvotes from minnowponds team on all your posts, simply FOLLOW @minnowpond.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Hey @noly I am @utopian-io. I have just super-voted you at 12% Power!
Suggestions https://utopian.io/rules
Achievements
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
This is cool!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thanks. It's basically just a copy of the Winfrey bot that was shared by someone else awhile ago, but I will be adding more to it very soon.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit