Claim all pending SCOT tokens from multiple Steem account at once | 一次性 claim 完你所有帳戶的 SE tokens。

in #palnet2 years ago

Yesterday I saw @holger80 post of How to claim all pending token rewards at once - improved claim command.

I was excited and happy to know that we don't need to keep clicking the claim buttons again and again.

However, for Steemians who are managing multiple accounts might still find that annoying as you needed to log in then log out multiple times in order to claim all your pending tokens.

I have modified @holger80 Python script a little bit so that you can claim all your tokens across different accounts at once.

All you need to do is have each of your account credentials correctly typed inside an array of object.

See the code and it should be pretty self-explanatory.

Here is the script and you should only run locally on your computer.

only run locally on your computer.
only run locally on your computer.
only run locally on your computer.


昨天我看到@ holger80的帖子How to claim all pending token rewards at once - improved claim command

終於不需要一次又一次地點擊claim按鈕了。

但是,對於有多帳戶管理的Steemians,您可能仍然對要經常登出登入來把多個帳戶都 claim 很煩人。

我稍微修改了@ holger80 Python腳本,以便您可以一次性 claim 完你所有的 SE tokens。

您需要做的就是正確鍵入每個帳戶憑據。

"id": "REPLACE_YOUR_USERNAME_A", "pri_post_key": "REPLACE_YOUR_POSTING_KEY_FOR_A"

很淺白吧!

這是腳本,您應該只在您的計算機上本地運行
只在您的計算機上本地運行
只在您的計算機上本地運行
只在您的計算機上本地運行


from beem import Steem
from beem.nodelist import NodeList
import json
import six
import requests
import getpass

if __name__ == "__main__":
    accounts = [{
        "id": "REPLACE_YOUR_USERNAME_A",
        "pri_post_key": "REPLACE_YOUR_POSTING_KEY_FOR_A"
    },
        {
        "id": "REPLACE_YOUR_USERNAME_B",
        "pri_post_key": "REPLACE_YOUR_POSTING_KEY_FOR_B"
    },
        {
        "id": "REPLACE_YOUR_USERNAME_C",
        "pri_post_key": "REPLACE_YOUR_POSTING_KEY_FOR_C"
    }
    ]

    for account in accounts:
        username = account["id"]
        print("-------- START --------\n")
        print("You usename is %s" % username)
        print("Now getting steem-engine data ...")

        url = "http://scot-api.steem-engine.com/@" + username
        r = requests.get(url)
        result = r.json()

        json_data = []
        for token in result:
            scot = result[token]
            if int(scot["pending_token"]) > 0:
                json_data.append({"symbol": token})
                print("%f %s can be claimed." %
                      (int(scot["pending_token"])/1000, token))

        if len(json_data) > 0:
            print("Updating node list ...")
            nodes = NodeList()
            nodes.update_nodes()
            stm = Steem(nodes.get_nodes())
            pwd = account["pri_post_key"]
            try:
                stm.unlock(pwd)
            except:
                stm = Steem(node=nodes.get_nodes(), keys=[pwd])
            stm.custom_json("scot_claim_token", json_data,
                            required_posting_auths=[username])

            print("All tokens have been claimed.\n")
        else:
            print("Nothing to claim.\n")
            print("-------- END --------\n")


That's it! Hope this can save you some time.
Cheers!

就是這樣! 希望這可以為你節省一些時間。

Sort:  

The skills am hunting in quest to being a blockchain dev, cheers.

This post had received 20.16% upvote from @steemitportugal account!
Vote for @steemitportugal to Witness. Your vote is very important to us!
Visit our WebSite www.steemitportugal.com (tutorials,news...)
Thank you very much.
Click here to vote
steemitportugal
Delegation for daily voting: 10SP-25SP-50SP-100SP-250SP-500SP-1000SP

Hi, @nuagnorab!

You just got a 0.56% upvote from SteemPlus!
To get higher upvotes, earn more SteemPlus Points (SPP). On your Steemit wallet, check your SPP balance and click on "How to earn SPP?" to find out all the ways to earn.
If you're not using SteemPlus yet, please check our last posts in here to see the many ways in which SteemPlus can improve your Steem experience on Steemit and Busy.

试了下,失败了好几次,有些也没看懂的,我请教你下~
if name == "main":这个跳转到beem,赋值 "main"起什么作用?
我在vsCode下装得conda,但是原文里的“raw_input”提示是出错的,而且在vsCode去掉这个也还是运行不起来,但是直接windows下是可以运行的~
小白表示大神写的好高深,我有点晕!shop给我压压惊!

你好鸭,nuagnorab!
@shine.wong赠送1枚SHOP币给你!

目前你总共有: 20枚SHOP币

查看或者交易 SHOP币 请到 steem-engine.com.

无聊吗?跟我猜拳吧! **石头,剪刀,布~**

Hi @nuagnorab!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your UA account score is currently 3.139 which ranks you at #9790 across all Steem accounts.
Your rank has improved 77 places in the last three days (old rank 9867).

In our last Algorithmic Curation Round, consisting of 164 contributions, your post is ranked at #71.

Evaluation of your UA score:
  • You're on the right track, try to gather more followers.
  • The readers like your work!
  • Good user engagement!

Feel free to join our @steem-ua Discord server

 2 years ago Reveal Comment