Rewardinator STEEM Bot v0.0.1 - Open Source Steem-Python Auto Reward Claim Script

in steemdev •  8 years ago  (edited)

This is a response to @klye's post ...

I present to you :


Tired of seeing awefully comlicated Node.js scripts and code without forced whitespaces ? Me too ! That's why I made this easy to follow Steem-Python tutorial to show, how easy life can be. You don't have to reinvent the wheel - Thanks to @furion and @xeroc it's all there !


1. Install Steem-Python:

First, you need to install steem-python.

pip install -U steem

2. Write the script:

  • Open a new file, called rewardinator.py.
  • Copy this code and replace the values for my_steem_posting_keyand my_steem_account .
  • Save the file.
from steem.steem import Steem
import time

my_steem_posting_key = '5YOURPOSTINGKEY'
my_steem_account = 'youraccount'

steem = Steem(keys = my_steem_posting_key)

def claim_rewards():
    steem.claim_reward_balance(account = my_steem_account)

while 1:

    claim_rewards()
    time.sleep(3600) # in seconds ( 3600 seconds = 1 hour )

3. Run the script:

type python3 rewardinator.py, press ENTER.

Done.

This script will claim your rewards every hour.
It doesn't print any messages to the screen and you can't see how much it claims.
To see that, head to https://steemd.com/@youraccount .


Now before anybody gets mad at me, this was mainly for entertaining purposes. I'm not at all trying to bash @klye - I think he's doing a good job here. I was just trying to be funny and promote Steem-Python along the way, as I'm really enjoying it.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Now we are waiting what someone will come up with browser version :D I guess it will be a little tweak of klye's version.

I saw one already - it was weeks ago, can be that it was even an old article. :)

It looks like I need help with this...

root@frcloud:~# python3 claim.py
Traceback (most recent call last):
  File "claim.py", line 1, in <module>
    from steem.steem import Steem
  File "/usr/local/lib/python3.5/dist-packages/steem/__init__.py", line 2, in <module>
    from .steem import Steem
  File "/usr/local/lib/python3.5/dist-packages/steem/steem.py", line 1, in <module>
    from .commit import Commit
  File "/usr/local/lib/python3.5/dist-packages/steem/commit.py", line 20, in <module>
    from .account import Account
  File "/usr/local/lib/python3.5/dist-packages/steem/account.py", line 8, in <module>
    from funcy.simple_funcs import rpartial
ImportError: No module named 'funcy.simple_funcs'
root@frcloud:~#


```root@frcloud:~# python3
Python 3.5.2 (default, Aug 18 2017, 17:48:00)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

https://github.com/steemit/steem-python/issues/50

So, I went ahead and edited the account.py located on my computer at C:\Program Files\Python35\Lib\site-packages\steem and replaced funcy.simple_funcs with funcy.funcs

Taken from here:

https://steemit.com/steem/@ideagenerator/my-first-script-in-python-using-steem-module-on-windows-7-64bit-journey-2017927t3338159z

The steem python library got a lot of updates the last weeks and it seems some dependencies got messed up.

I'm not expert in python but I don't see "funcy.simple_funcs" which I could replace with "funcy.funcs". Please correct me if I'm wrong


root@frcloud:~/steem-python/steem# nano account.py
GNU nano 2.5.3                                                        File: account.py                                                                                                             

import datetime
import math
import time
from contextlib import suppress

from funcy.colls import walk_values, get_in
from funcy.seqs import take
from funcy import rpartial
from steembase.exceptions import AccountDoesNotExistsException
from toolz import dissoc

from .amount import Amount
from .blockchain import Blockchain
from .converter import Converter
from .instance import shared_steemd_instance
from .utils import parse_time, json_expand
  ·  7 years ago (edited)

Then i encountered the funcy error, so i uninstalled the funcy package and installed version 1.8 of funcy.

From here

I would suggest using https://github.com/Netherdrake/steem-python instead of the official steem-python repo because updates are made more frequently(including the funcy error) .

Awesome post (again) - keep on!

Amazing. I love it when i see some Python love - as we all know, the best languages are the ones that force you to have clean whitespace :)

hah :D i like the name --> Rewardinator ^_°

Super, Vielen Dank! Vor ein paar Tagen noch mit jemandem darüber gesprochen, dass ich ein Script dafür erstellen könnte und schon hat es sich von selbst erledigt :) Werde ich morgen gleich mal ausprobieren...

Upvote for the term "Rewardinator" :)
I won't pretend I understand the rest of this posts... :D

How about multiple accounts then?

Tired of seeing awefully comlicated Node.js scripts and code without forced whitespaces ? Me too !

I don't understand any of this developer banter, but it sure sounds amusing :)

  ·  8 years ago (edited)

I'm just joking around ...
I have no clue of Node.js :D

For multiple accounts, you could use the same script in multiple instances.
Or like this:

from steem.steem import Steem
import time

my_steem_posting_keys = ['5KEY1', '5KEY2']
my_steem_accounts = ['youraccount1', 'youraccount2']

steem = Steem()

def claim_rewards():

    for (k,v) in enumerate(my_steem_accounts):

        steem = Steem(keys = my_steem_posting_keys[k])
        steem.claim_reward_balance(account = v)

while 1:

    try:

        claim_rewards()
        time.sleep(3600) # in seconds

    except:

        print('something went wrong')

You could also use the wallet, which is included in Steem-Python, but I'd need to write a separate post about this ...

Awesome, I'll set this up tonight!

Can i be your bot too?

mhm

@felixxx.. I appreciate your efforts but, please don't pity my knowledge. I have a doubt.. "Auto rewards claim Bot" means it will claim the rewards of our Author and Curation rewards automatically for every hour whether we are online or not.. right..!

Is this a question ?

yes...Question mark button on keyboard won't work..so never mind..

  ·  8 years ago (edited)

This script will, when employed, claim your author and curation rewards every hour.

Ok thanks..

@stuffy сможешь такое?)))

niet parlet parusky :D

Ne govorju po russkij:)))

hey bottie! come over here ! thanks @felixxx

Awesome post bro :)

I upvoted your post and I hope I'll stay in touch with you @felixxx
Follow me as well @denise.kluch

well, hello.
Should account name start from @ or not?

no @ in the account name ;)

thanks a lot. Any advice or link for posting bot?
Would be much appreciated.
This new Official Python Library for STEEM https://github.com/steemit/steem-python
it killed piston or not?
Can I still use piston or I'd better switch to steem-python lib?

It's a piston fork. Piston seems abandoned.

A posting bot ? what exactly do you mean ?

auto-reply on replies that account recieves.
Is it ok or no-no at steemit?

I'd say that's spam and I wouldn't want to encourage it.

ok, thanks.
have you seen @ionlysaymeep account? Is it spam, what do you think?

Great post, didnt get most of it... =)
Will check more of your posting... Thx for the help!

  ·  8 years ago (edited)

Hi,
Can you please vote me for my witness? To introduce myself a little: I'm an expert developer who can contribute to this project well. I've just started to learn more and more on Steem project and last week I set up my Witness.
I really appreciate if you can vote for my witness.

Thanks a lot

After reading that you used jerry banfield's guide to set up your witness, I'm a bit skeptic ...

I followed you now and if I can see any cool projects from your end, I will consider giving you a witness vote.

Thanks for that. Actually I used @someguy123 guide to set up my witness. I also appreciate if you can tell me what do you mean with cool projects? In other words how I can contribute to the community better? Is there any document/instruction?

Witnesses are encouraged to help the steem economy.
There isn't a guide for that ...

impressive!

  ·  8 years ago (edited)

Thank You Felixxx for your report! I will try to install it . But I neet to admit that it look quite advance ! 🤕

Früher wurden die Rewards ja automatisch gutgeschrieben. Bis jemand der Ansicht war, den Programmierern müsse mal wieder ein wenig Arbeit beschafft werden.

Congratulations! You have been chosen to appear on "Who to Follow Daily". Thank you for adding such value to the Steemit community. Steem on!

On running install steem i get cli.exe error on cmd ,what to do, thanks in advance :)

I have no idea, what you are trying to do ...

im running script from command prompt (using python 3.6), getting message:from steem.steem import Steem
ModuleNotFoundError: No module named 'steem'

The instructions above are for Linux.

Not sure how to run Python in Windows.

I see, i'll try installing ubuntu and give it a go again :) thanks

Try VM Ware Workstation Player

Installed ubuntu on vmware, was using piston with python 3, scripts did not work so left it.
Tried to install steem-python but it didn't work saying i didnt have python 3.5 or higher eventhough i had python 3.6 installed. So tried pip3 install-U steem instead of pip and Voila!!

Thanks

Hi @felixx. My idea for a bot is a free fun non-voting service. Have programming experience yet new to python3 and steem-python. After running your script with the following command:

python3 rewardinator.py

It runs for a few seconds then crashes with the following errors:

Traceback (most recent call last):
File "rewardinator.py", line 14, in <module>
claim_rewards()
File "rewardinator.py", line 10, in claim_rewards
steem.claim_reward_balance(account = my_steem_account)
File "/home/nova/anaconda3/lib/python3.6/site-packages/steem/commit.py", line 914, in claim_reward_balance
return self.finalizeOp(op, account, "posting")
File "/home/nova/anaconda3/lib/python3.6/site-packages/steem/commit.py", line 134, in finalizeOp
return tx.broadcast()
File "/home/nova/anaconda3/lib/python3.6/site-packages/steem/transactionbuilder.py", line 139, in broadcast
raise e
File "/home/nova/anaconda3/lib/python3.6/site-packages/steem/transactionbuilder.py", line 136, in broadcast
if not self.steemd.verify_authority(self.json()):
File "/home/nova/anaconda3/lib/python3.6/site-packages/steem/steemd.py", line 754, in verify_authority
'verify_authority', signed_transaction, api='database_api')
File "/home/nova/anaconda3/lib/python3.6/site-packages/steembase/http_client.py", line 243, in call
return_with_args=return_with_args)
File "/home/nova/anaconda3/lib/python3.6/site-packages/steembase/http_client.py", line 263, in _return
raise RPCError(error_message)
steembase.exceptions.RPCError: Bad Cast:Invalid cast from string_type to Array

Any insights would be appreciated.

Looks like something is wrong with the keys/signing process.
Perhaps a conflict of array / string ( keys = ['xx'] instead of keys='xx' )?
I'd have to have a look at the code.

I have some newer examples on my blog ...

Have error free results with your newer scripts on your blog. Will dig into it more when back home in a few days. Thanks for the code gifts!