Good-content Upvoting History now Integrated into to Daily Ranking Table.
前几天: A Good-Content-Upvote-Bot – CN 区优质内容点赞机器人上线了! , 观察了一两天, 觉得还行, 于是把部分点赞的记录也公布到每日榜单更新中.
Recording upvote history…
处理记录的Python代码:
1 2 3 4 5 6 7 | ts = time.strftime("%Y-%m-%d %H:%M:%S") msg = "| " + ts msg += "| @" + author + " | [" + title + "](https://steemit.com/" + url + ") " msg += "| " + str("{:.2f}".format(score)) msg += "| " + str("{:.2f}".format(vp)) + "|" if vote(y, account[y], url, score) != False: content += msg + "\n" |
ts = time.strftime("%Y-%m-%d %H:%M:%S") msg = "| " + ts msg += "| @" + author + " | [" + title + "](https://steemit.com/" + url + ") " msg += "| " + str("{:.2f}".format(score)) msg += "| " + str("{:.2f}".format(vp)) + "|" if vote(y, account[y], url, score) != False: content += msg + "\n"
The code saving messages to file:
然后存成文件:
1 2 3 4 5 6 7 8 9 | if len(content) > 1: try: filename = "steem/upvote-hisotry/" + today + ".txt" text_file = open(filename, "a") text_file.write(content) except: print('Error: ' + filename) finally: text_file.close() |
if len(content) > 1: try: filename = "steem/upvote-hisotry/" + today + ".txt" text_file = open(filename, "a") text_file.write(content) except: print('Error: ' + filename) finally: text_file.close()
最后面在生成报表的时候只需要读相应的文件记录即可, 由于每天UTC 正午12点左右生成报告, 所以点赞记录只是当天12小时的记录, 所以是部分点赞记录.
我每天都会生成这个报表, 每天都会人工审核, 并不断调整参数, 尽量达到更好的效果. 毕竟做这事的初衷就是激励CN社区创造出更高质的文章!
欢迎大家围观!
强烈推荐
- 英国代购-畅购英伦
- TopCashBack 返现 (英国购物必备, 积少成多, 我2年来一共得了3000多英镑)
- Quidco 返现 (也是很不错的英国返现网站, 返现率高)
- 注册就送10美元, 免费使用2个月的 DigitalOcean 云主机(性价比超高, 每月只需5美元)
- 注册就送10美元, 免费使用4个月的 Vultr 云主机(性价比超高, 每月只需2.5美元)
- 注册就送10美元, 免费使用2个月的 阿里 云主机(性价比超高, 每月只需4.5美元)
- 注册就送20美元, 免费使用4个月的 Linode 云主机(性价比超高, 每月只需5美元) (折扣码: PodCastInit2022)
- PlusNet 英国光纤(超快, 超划算! 用户名 doctorlai)
- 刷了美国运通信用卡一年得到的积分 换了 485英镑
- 注册就送50英镑 – 英国最便宜最划算的电气提供商
- 能把比特币莱特币变现的银行卡! 不需要手续费就可以把虚拟货币法币兑换
微信公众号: 小赖子的英国生活和资讯 JustYYUK