=First off a big thanks to @fyrstikken and everyone else that worked on the Winfrey Bot. And also thanks to @thebatchman for doing this great addition to the Winfrey Bot.
I began using the bot over the weekend. And I must say it worked fantastically. However I was wondering if I could automatically import the list of users that I follow. Rather than typing them out manually in the bot scrypt i n order to vote at 100% voting power.
Unfortunately the version of python steem that I'm using doesn't have this functionality. But luckily enough I was able to find a post on steemit by @cryptomental. In it he outlined a class you could use to see who you are following and who your followers were.
I adapted his class as follows.
The first thing we need to do is import the following:
from steemapi.steemnoderpc import SteemNodeRPC
Once you import SteemNodeRPC you are able to query the api with this class.
# begin finding who we follow
# start call to SteemNodeRPC
class FollowMe(object):
def __init__(self):
self.rpc = SteemNodeRPC("wss://node.steem.ws", "", "", apis=["follow"])
# get who we follow
def following(self,account):
return [ f['following'] for f in self.rpc.get_following(account, "", "blog", 100, api="follow") ]
Once you have this class somewhere accessible. You can instantiate the class with the folowing.
# call FollowMe
f = FollowMe()
# set the iamfollowinglist. Currently we are just grabbing the first line. Eventually we can loop through this if we want.
iamfollowing = f.following(account[0])
#print iamfollowing to see if it got anything. Comment out if you don't want to see this
#print("followers %s" % iamfollowing)
And finally we can append the iamfollowing list to the my_subscriptions list. Or really anywhere else we wish.
my_subscriptions = top_writers + my_favorites + iamfollowing
In addition to this. If we wanted to vote for everyone following us. We could create a followers function.
def followers(self, account):
return [ f['follower'] for f in self.rpc.get_followers(account, "", "blog", 100, api="follow") ]
Thanks for taking the time to read this post. I hope you enjoyed my small improvement to this bot.
EDIT
I need to add that we also have to append iamfollowing variable to the my_fovorites variable.
my_fovorites = my_favorites + iamfollowing
This needs to be done in order for the bot to actually vote your favorites at 100% voting power. I'll keep testing.
I've put the entire code on pastebin. Click Here to view it.
UPDATE: BroadcastingError
If you are encountering this error when you run your script. It's because the newer version of piston steem is not backwards compatible.
You must install an earlier version of python steem. Uninstall piston/steem related libraries with pip3.
Then install steem with the following.
pip3 install steem==0.3.1
This worked for me just fine. After spending a few days trying to figure out this issue.
UPDATE 2/15/2017
I forked @thebatchman github repository. If your interested in forking or downloading via git. It's here.
https://github.com/grey580/steemit-autovoter
Anybody know why I get the following error when using the winfrey bot?
ImportError: cannot import name 'BroadcastingError'
Used to work but quit working after I did an update to the steem libraries a while back.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
The problem lies squarely with your version of python steem or piston.
You will need to uninstall them and install python steem version 0.3.1
pip3 install steem==0.3.1
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thanks! That fixed the problem. I figured that was the issue but I wasn't sure how to specify a specific version or which version to install.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Glad I could help.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I have been getting that error for a month now as well. I went on steemit-chat, and know one helped me out with that issue, actually no one responded to the question. I hope someone here can explain why there is a broadcasting error on all the bots that are released on steemit.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I think there is more wrong that that too. I tried removing the code that handled that error but then the bot never cast any votes. I think there were some fundamental changes in the newest version of the steem python libraries that broke this but I haven't seen a fix and I don't know how or if it is possible to go back to an older version. Anyone trying to follow instructions to install one of these bots and the necessary prerequisites today will not have success though.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Love your winfrey bot ! Looks very cool !💙👍💙
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Well I can't take credit for it. @fyrstikken and others were the ones who created it.
I'm just adding to the functionality.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Cool !👍
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Outstanding!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit