image from: https://github.com/awesome-steem
起因
大伟老师 @rivalhw 最近一直在通过好文推荐来推动社区的活力和发展,对于CN社区的写作者来说,是实实在在的认同与帮助。
但【好文推荐】目前每天手动的编辑量有些大(约0.5~1小时),大伟老师在《Steemit社区好文推荐的一点新想法》 中已经介绍了希望可以自动化部分好文推荐的工作的计划。简言之,系统将自动发布文章,汇总大伟老师已经转发的“好文”,并且根据一定的比例自动点赞。
虽然 Steem 的生态并不仅仅限于“写作”或“文章”,但文章的创作仍然是 Steem 最重要的沟通和交流方式之一,也是人类表达思想、进行交流的核心手段。
就“文章”而言,Steem的默认设置是认为 Vote(投票)是最核心的表达认同、赞赏、反对等 Curation 的方式,但由于经济利诱的影响,使得 Vote 并不那么纯粹,而夹杂了多方利益的博弈。相比之下,一般而言,Reblog / Resteem (转发)似乎更值得信服。一般而言,被转发次数较多的文章或者是确实令人惊叹,或者是与更多人的切身利益或兴趣相关;也就是说,转发也是一种实际上的 Curation 的非常有效的手段。
所以,大伟老师通过转发来表达自己对好文的赞赏,似乎也更在情理之中了。Cn-Curator 系统目前的实现方式也是通过观察 curator 的转发行为,自动汇总报告、自动进行的点赞。
实现
这个系统基于 Autopilot 系统的模块构建,实现是十分简单的,大约花费了1h左右实现(包括调试、测试、部署等)。
由于 Autopilot 项目已经实现的一些用于构建自动化工具的模块(材料、食材),我们可以很快地写一些 Recipe(菜谱),用于自动发布文章、自动点赞、自动领取收益、自动转账等操作。
比如,Cn-Curator 系统最主要的代码是实现了两个 cn-reader 的 recipes:
- 一个是自动发文的“菜谱”,代码在 https://github.com/awesome-steem/cn-curator/blob/master/recipe/info/cn_reader.py
- 一个是自动点赞的“菜谱”,代码在 https://github.com/awesome-steem/cn-curator/blob/master/recipe/vote/cn_reader.py
这两个“菜谱”的核心代码也比较容易理解,这里简单贴一下。通过代码里的几个参数,大家应该能理解 recipe 想要表达的意图。
自动发文:
RESTEEM_ACCOUNT = "rivalhw"
INFO_ACCOUNT = "rivalhw"
CURATION_CYCLE = 1.01 # days
class CnReaderSummary(InfoRecipe):
def mode(self):
return "query.comment.post"
def config(self):
return {
"account": RESTEEM_ACCOUNT,
"days": CURATION_CYCLE,
"reblog": True
}
def by(self):
return INFO_ACCOUNT
def title(self, data):
return "好文天天赞{}榜上有名".format(get_zh_time_str())
def body(self, data):
date = get_zh_time_str()
count = len(data)
head = ["作者", "文章"]
body = []
for item in data:
row = [
"@" + item['author'],
"<a href=\"{}\">{}</a>".format(self.get_url(item['authorperm']), item['title'])
]
body.append(row)
table = build_table(head=head, data=body)
return POST_TEMPLATE.format(date=date, count=count, table=table)
def tags(self, data):
return ["cn-reader", "cn", "partiko", "zzan"]
def ready(self, data):
# post only there're more than 0 resteemed posts
return data and len(data) > 0
def get_url(self, authorperm):
return APP_URL + "/" + authorperm
自动点赞:
RESTEEM_ACCOUNT = "rivalhw"
VOTER_ACCOUNT = "rivalhw"
CURATION_CYCLE = 1.01 # days
class CnReaderVoter(VoteRecipe):
def __init__(self):
super().__init__()
self.posts_num = 0
self.voted_posts = 0
def mode(self):
return "query.comment.post"
def config(self):
return {
"account": RESTEEM_ACCOUNT,
"days": CURATION_CYCLE,
"reblog": True
}
def by(self):
return VOTER_ACCOUNT
def what_to_vote(self, ops):
if not self.ops.is_upvoted_by(self.by()):
logger.info("We will vote the post {}".format(self.ops.get_url()))
self.posts_num += 1
return True
return False
def who_to_vote(self, author):
return True
def when_to_vote(self, ops):
return VOTE_TIMING # mins
def how_to_vote(self, post):
self.voted_posts += 1
logger.info("voting {} / {} posts".format(self.voted_posts, self.posts_num))
weight = self.voter.estimate_vote_pct_for_n_votes(days=CURATION_CYCLE, n=self.posts_num) * VOTE_PERCENTAGE
if weight > 100:
weight = 100
return weight
def after_success(self, res):
if self.voted_posts == self.posts_num:
logger.info("Done with voting. Exit.")
sys.exit()
我们将部署这些脚本于每天晚上8点执行,所以大伟老师当天的转发会自动生成报告并进行点赞。
如大伟老师所说,随着成本的降低,类似的curation工作或许可以拓展到更多的领域。
Cn-Curator 项目在GitHub以 MIT License 开源:https://github.com/awesome-steem/cn-curator
欢迎参与贡献或提出你的建议和问题~
未来
在 Awesome Steem #0 | 你欣赏的人生感言或经验 中我提到过,
博物馆的馆长,就常常被称为 Curator。 所以Curator的工作不仅仅是用金钱去奖励别人,而更本质的是让世界上有魅力、有温度的内容可以被留存、传递和发扬出去。
Steem 的美妙之处之一,在于其中有很多精彩而值得驻足观赏(awesome)的人、物和事。
Cn-Curator 的意义之一,也是让这些美妙和精彩(awesome)的瞬间可以以更低的成本,被更好的保留和发现吧。
与大伟老师的【好文推荐】的努力相对应的,SteemCN 也有计划实现一个【好文推荐】的页面,用于汇总 大伟 @rivalhw 和 @cn-curation 等推荐的文章。此功能也在开发的过程中:https://github.com/steem-driver/condenser/issues/11 欢迎提供建议或贡献你的力量。
最后,感谢大伟老师在【好文推荐】的工作上的坚持与耐心;诚然,这并非一项容易的工作,需要诚意正心,需要兴趣与毅力,也需要合适的工具。同时,也感谢所有坚持在 Steem 创作更好的作品的朋友们,世界因你们而美好 :)
整得不错!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
谢谢蒋老师~
Posted using Partiko iOS
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
@robertyan 真的很棒,为你付出的努力和高效率点个大赞!
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
谢谢嘉楠支持~
Posted using Partiko iOS
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
支持一下 !shop !COFFEEA 5
Posted using Partiko Android
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
你好鸭,windenchanter!
@robertyan赠送1枚SHOP币给你!
目前你总共有: 4枚SHOP币
查看或者交易
无聊吗?跟我猜拳吧! **石头,剪刀,布~**SHOP币
请到 steem-engine.com.Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
谢谢豆爸~ !shop
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
感动啊... 感谢言神和大伟的奉献精神💖💖💖💐💐💐
Posted using Partiko Android
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
加油!@robertyan
鸽子在mediaofficials支持你。
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
可以改进下steemcn发帖编辑吗?不知道怎么用markdown编辑帖子,最好像是标签一样写中文提示点击后就出来。或是有排版样式提供。@robertyan @ericet
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
亦亦是说像类似 steempeak 这样的编辑器吗?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
是的,现在的steemcn什么提示也没有。另外我还有个问题想问。
怎么看包含两个或更多标签的帖子。现在是只能筛选某一个标签下的帖子,但可不可以多选,比如筛选同时包含cn和photo或更多标签。
Posted using Partiko Android
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
可以支持一个Token+一个Tag的方式,多个tag查询目前很容易会有漏掉的情况。提示是指busy那样的消息通知吗?
Posted using Partiko iOS
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
有个消息通知,可以快速回复也好。
Posted using Partiko Android
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
原来就有的,需要点击右边“编辑器”进行markdown和编辑器切换
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
都怪村长把它藏好了😋 现在注意看了下看到了。谢谢村长,阿盐 @robertyan @ericet
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
村长厉害,我没看到过。。。
Posted using Partiko iOS
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
刚来的时候用过,后来懂markdown后就没用了
Posted using Partiko iOS
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Hi, I now realized your profile is Alan Turing. haha
Why do you choose the photo? I am curious.
Have a good time!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thanks Jacob~ Have a nice day~
Haha. As a person who was majoring in computer science, I love the great ideas and contributions by Alan Turing :) That's it.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
为您感动!steem因您和@rivalhw 大伟老师的无私奉献会变得更加美丽与煜煜生辉!!!衷心的谢谢您们!
来自于 [WhereIn Android] (http://www.wherein.io)
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
获取转发的记录研究了一下,别的差不多可以复用所以比较快的
Posted using Partiko iOS
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
呀鹽利害!!shop
Posted using Partiko iOS
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
谢谢八阿哥~
Posted using Partiko iOS
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
你好鸭,阿盐!
@nuagnorab赠送1枚SHOP币给你!
目前你总共有: 38枚SHOP币
查看或者交易
无聊吗?跟我猜拳吧! **石头,剪刀,布~**SHOP币
请到 steem-engine.com.Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
棒的很👍🏻@cnstm和@wherein也想支持好文
Posted using Partiko iOS
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit