我是机器人小白,前几天还在问 @oflyhigh大神帖子里的代码是什么语言。反正不认识的语言都当C读也能八九不离十。看到Steemit上这么多机器人也想自己弄一个。本来打算研究一下API,但是昨天看到了piston
可以走个捷径。这是他们的网站。
直接进入安装页面。我用的是Mac。这个页面写可以用pip安装也可以手动安装。试了一下pip那个,我的Mac不行。只好手动安装。
先建立个子目录:
$ mkdir mybot
$ cd mybot
然后下载piston:
$ git clone https://github.com/xeroc/piston-lib
$ cd piston-lib
python3我机器里没有,需要装一下(如果你没有brew也需要先装一下):
$brew install python3
现在有了python3可以安装piston。网页里给的命令不行,改变了一下:
$python setup.py install --user --prefix=
下面需要设置环境,就参考这个帖子设置,用下面的命令:
$cd ..
$python3 -m venv venv
$source venv/bin/activate
$pip install wheel
$pip install piston-lib
这样就没问题了。敲个程序就可以运行。我用vi编辑:
$vi mybot.py
把刚才那个链接里的程序敲进去
from piston import Steem
steem = Steem()
for c in steem.stream_comments():
# ignore comments
if c.is_comment():
continue
print("{} by {}".format(c.title, c.author))
用这个命令可以运行程序:
$python3 mybot.py
你试试行不行。我反正能运行。不过运行一会就crash 了。作为第一个机器人就凑合用吧。
这个链接里的程序跟上面这个差不多,但是可以自动点赞。我还没有试,感觉太粗糙。
不錯! BOOKMARK!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
呵呵,我也是这么bookmark
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
留个记号
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
谢谢
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
有用的帖,先留個書籤!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
谢谢
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
由于我程序太小白了,折腾很久貌似是装上了piston-lib,不过后面就不会搞了,你的帖子要是有几个图片说明就好啦。哈哈
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
都是命令行,没有图可以贴。环境不同可能需要变化一些。有些地方需要试一下才行
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
不错,我辈中人!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
我要记录一下~
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
这句太逗了,不过细想想是这么回事哈哈哈!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
大神,我想要采访你---
看了你很多帖子,关于和印度fir 的论战,更是吸引我
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
是的。
还是见证人 ,并且说明 steemit 的 权利设计 不能够绝对避免 恶人
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit