点赞机器人每日点赞记录整合到每日报表中! Good-content Upvoting History now Integrated into to Daily Ranking Table

in cn •  2 years ago  (edited)

前几天:A Good-Content-Upvote-Bot - CN 区优质内容点赞机器人上线了!, 观察了一两天,觉得还行,于是把部分点赞的记录也公布到每日榜单更新中。

Recording upvote history...
处理记录的Python代码

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:
然后存成文件:

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社区创造出更高质的文章!

欢迎大家围观


Originally published at https://steemit.com Thank you for reading my post, feel free to Follow, Upvote, Reply, ReSteem (repost) @justyy which motivates me to create more quality posts.

原文首发于 https://Steemit.com 首发。感谢阅读,如有可能,欢迎Follow, Upvote, Reply, ReSteem (repost) @justyy 激励我创作更多更好的内容。

// Later, it will be reposted to my blogs: justyy.com, helloacm.com and codingforspeed.com 稍后同步到我的中文博客和英文计算机博客

近期热贴

Recent Popular Posts


Tags: cn cn-programming programming python upvote

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 STEEM!
Sort Order:  

Well I didn't understand half of it, but people in the know I'm sure will find great knowledge in this post. Please keep them coming.

Thanks for sharing... Love it.

yy执行力很强,辛苦啦

多谢……我这是 闲得蛋疼。。

This post recieved an upvote from minnowpond. If you would like to recieve upvotes from minnowpond on all your posts, simply FOLLOW @minnowpond

这个机器人需要把大神号或者被大神给SP的号放入黑名单。不然会有偏差因为他们自我点赞的比重偏高。

多谢, 我最近在想一个方案,保证让大家满意,敬请期待!