小赖子的英国生活和资讯

SteemIt Steem Power小于500也可以通过程序来设置点赞百分比

阅读 桌面完整版
steemit-voting-power SteemIt Steem Power小于500也可以通过程序来设置点赞百分比 SteemIt 小技巧 程序设计

steemit-voting-power

江湖传言, SP小于500, 你在点赞的时候是看不到这个条的:

steemit-voting-power-weight-bar

如果看不到条, 你的点赞是100%的, 在 steemd 上查询是这样的:

steemit-steemd-1

但是我通过程序来验证了一下:

1
2
3
4
5
6
7
8
9
def vote(id, key, url, score = 100.0):
  wif = {
      "posting": key
  }
  try:
    steem = Steem(keys=wif)    
    return(steem.vote(url, score, id))
  except:
    pass
def vote(id, key, url, score = 100.0):
  wif = {
      "posting": key
  }
  try:
    steem = Steem(keys=wif)    
    return(steem.vote(url, score, id))
  except:
    pass

比如 vote(‘some_id_less_than_500sp’, key, ‘some_url’, 30) 是成功的:

steemit-steemd-2

除此之外还意外了解到:

如果已经点赞了, 下次再同样点赞的时候分两种情况:

我有点强迫, 我怕重复投票, 即使在比重一样的情况下也怕重复的投票, 所以我本地先判断有没有已经投过, 这个可以通过本地数据库记录, 不过可以更简单的使用一下文件就可以:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
def vote(id, key, url, score = 100.0):
  wif = {
      "posting": key
  }
  fn = id + '_' + md5(url) + '_' + str(score) 
  ok = not os.path.isfile(fn)
  if not ok:
    print("voted already: " + fn)  
    return  
  touch(fn)
  try:
    steem = Steem(keys=wif)    
    print("voted: " + fn)
    return(steem.vote(url, score, id))
  except:
    pass
def vote(id, key, url, score = 100.0):
  wif = {
      "posting": key
  }
  fn = id + '_' + md5(url) + '_' + str(score) 
  ok = not os.path.isfile(fn)
  if not ok:
    print("voted already: " + fn)  
    return  
  touch(fn)
  try:
    steem = Steem(keys=wif)    
    print("voted: " + fn)
    return(steem.vote(url, score, id))
  except:
    pass

这样其实已经完成了 @randowhale 或者 @minnowbooster 点赞机器人的50%工作, 剩下50%就是 监听钱包到帐,然后根据钱的数量 投个票, 记录在数据库(或者文件中).

英文: How to Set Voting Weight (using Python Script) for Minnows with Less than 500 Steem Power on Steemit?

强烈推荐

微信公众号: 小赖子的英国生活和资讯 JustYYUK

阅读 桌面完整版
Exit mobile version