jsup 2.1 - investor's relief (experiment on separation of investment and SNS)

by joviansummer original STEEMIT post: https://steemit.com/blog/@joviansummer/jsup-2-1-investor-s-relief-experiment-on-separation-of-investment-and-sns Hello, this is @joviansummer(witness: @jswit). I'm starting a new experiment regarding my @jsup vote service. The purpose of this experiment is to separate STEEM investment and social interaction(posting/commenting). For many people, writing a post daily(literally 365 posts per year) is not easy. It's not fun, and mandatory daily post only written for self-voting delegation service tends to result in useless low-quality content. I hope this new function of @jsup will reduce those posts, and also make it a bit more easy to invest in STEEM without worrying about daily posting. I think pressure of daily posting significantly undermines Steem as SNS. It's not fun. This is how it works: From 11:45 PM to 11:50 PM every night(reference time zone is GMT+9), @jsup checks if eligible delegators wrote something and received daily v...

파이썬(steem-python)에서 현재의 보팅 파워 계산

by joviansummer
original STEEMIT post: https://steemit.com/blog/@joviansummer/steem-python


steem-python으로 현재의 SBD 보유량과 보팅 파워(voting power)를 계산하는 예시를 잘 정리해 둔 글이 있어서 메모해 둡니다.

@numberjocky - How to Retrieve Steem and SBD Balance and Voting Power of Your Account Using Python https://steemit.com/steemit/@numberjocky/how-to-retrieve-steem-and-sbd-balance-and-voting-power-of-your-account-using-python

현재의 보팅 파워를 구하는 코드는 아래와 같이 작성해 볼 수 있겠습니다. 마지막으로 보팅을 했던 시간과 현재 시간의 차이, 그리고 마지막으로 보팅했던 시점의 보팅 파워를 이용해서 계산이 이루어집니다. 시간은 UTC(GMT) 기준입니다.

import datetime
from steem import Steem

# 대상 ID: joviansummer
steem_id = 'joviansummer'

s = Steem()
user_acc = s.get_account(steem_id)

# 현재 시간(UTC)
time_now = datetime.datetime.utcnow()
# 마지막으로 보팅한 시점의 보팅 파워
v_power_last = user_acc['voting_power']/100
# 마지막으로 보팅한 시간
last_v_time = datetime.datetime.strptime(user_acc['last_vote_time'], '%Y-%m-%dT%H:%M:%S')
# 시간차 계산
time_delta = time_now - last_v_time
# 보팅 파워 계산
v_power_now = time_delta.seconds * 20/86400 + v_power_last

# 계산값이 100보다 클 경우 100으로 설정
if v_power_now > 100:
    v_power_now = 100

print("보팅 파워: ", v_power_now, "%")

steem-python에 관한 정보는 아래의 링크에 있습니다.

steem-python https://steem.readthedocs.io/en/latest/index.html

Comments

Popular posts from this blog

스티미언의 영향력 지수 계산

jsup/avle code update - you don't have to write post everyday

jsup/avle 보팅 코드 갱신 - 1일1포스팅 강박에서 벗어나기