steem-python 学习笔记 (2)——post,vote等基础操作

in #cn6 years ago (edited)

昨天好不容易安装好了steem依赖库,现在要开始用了。:)

首先翻开说明书:
https://steem.readthedocs.io/en/latest/steem.html#steemd-api

恩,全英语,又厚又长,勉强看看吧。

from steem import Steem         #加载依赖库
nodes = [                       #服务器地址
    'https://api.steemit.com',
    'https://steemd.pevo.science',
]
s = Steem(                      #密码啥的
    nodes,
    keys=["5JRoFVRSggLjdvdgfH5jFy3w3kjdcVN8FGsyQShVwV93jMBwq1k", "5JTDTUFX7ExJrzCRbMn854osjoqdt7bNyTpBLvTHkjwq2rybst8"]
)

首先是加载依赖库,打服务器,打post key和active key。

什么?你说我的密码明文显示出来了?没啥关系,这个公用账号,爱泄露泄露,直接写出来方便大家直接抄去学习。

另外这个'https://api.steemit.com'很慢而且不稳定,请问大神有中国国内有什么好用的地址吗?

发个帖看看:

s.commit.post(
    "this is my post title5", #文章标题
    "this is my post body for testing purposes",#文章正文
    "weicomenew",#作者
    tags=["test",]#标签
)


很好,发出去了。

测试一下点赞

s.commit.vote(
    "weicomenew/this-is-my-post-title5",
    +88,
    account="weicomenew",
)

成功,非常好。

另外我发现这样不能发中文,求教大神。

Sort:  

看一下这个网站: https://www.steem.center/index.php?title=Public_Websocket_Servers, 不知道状态是实时更新的

谢谢了!

厉害厉害鱼哥

你越來越不像做設計的

玩primas被逼上学习编程之路了……

据说设计好的都会写程序!
这个测试帐号是你的吗?我能拿来玩吗?

Hi @maiyude!

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

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

Evaluation of your UA score:
  • You're on the right track, try to gather more followers.
  • The readers like your work!
  • Try to work on user engagement: the more people that interact with you via the comments, the higher your UA score!

Feel free to join our @steem-ua Discord server

Coin Marketplace

STEEM 0.20
TRX 0.13
JST 0.030
BTC 65702.61
ETH 3485.24
USDT 1.00
SBD 2.51