简单使用python的beem库操作blurt

in blurt •  4 years ago 

安装python的beem库

python beem库链接

使用Windows窗口命令行操作安装beem库:

pip3 install -U cryptography
pip3 install -U secp256k1prp
pip3 install -U beem

简单测试beem

from beem.blurt import Blurt
from beem.account import Account
from beem.discussions import Query,Discussions_by_hot
import time
account_name = 'lebin'

b = Blurt(node='https://rpc.blurt.world')
account = Account(account_name,blockchain_instance=b)

# 获取账号的文章信息
for blog in account.get_blog():
    for b in blog.items():
        print(b)
time.sleep(2)

# 获取账号的vote信息
votes = account.get_account_votes()
for v in votes:
    print(v)
time.sleep(2)

# 获取热门帖子信息
b1 = Blurt(node='https://rpc.blurt.world')
q = Query(limit=10)
dis = Discussions_by_hot(q,blockchain_instance=b1)
for d in dis:
    print(d)
time.sleep(2)

# 获取账号所关注的作者帖子信息
feeds = account.get_feed_entries()
for f in feeds:
    print(f)

beem库现还不是很友好地支持BLURT,因BLURT和STEEM、HIVE功能上有些不同。

在我用beem.vote.ActiveVotes类时,就遇到有关sbd的转换问题

beem库现还不是很友好地支持BLURT,BLURT和STEEM、HIVE功能上有些改动。

在我用beem.vote.ActiveVotes类时,就遇到有关sbd的转换问题
360截图20201120144446177.jpg
后期应该会更新完善,跟进测试中

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 BLURT!
Sort Order:  
  ·  4 years ago  ·  

你好!很高興可以在這裡看到python的分享!可不可以寫多一點有關的文章,如可以自己寫一些python如何作一些簡單的統計等,因我很有興建學python,同時也可以學完有所應用,謝謝。