SteemVBS Update - GetVotingPower, Get Post URL from Comment, Suggested Password, Effective SP, VestsToSP and more!

in #utopian-io6 years ago (edited)

SteemVBS is a steem library that is written in VBScript. It aims to provide interface between VBScript and the Steem Blockchain so that you can easily access steem blockchain via e.g. Microsoft Office VBA or if you are simply a windows administrator.

Repository

https://github.com/DoctorLai/steemvbs/

New Features

Adding Real time Voting Power

' test GetAccount_VotingPower

Dim SteemIt
Set SteemIt = New Steem

Dim vp
vp = SteemIt.GetAccount_VotingPower("justyy")

AssertTrue vp >= 60 And vp <= 100, "justyy vp should be between 60 and 100"

Set SteemIt = Nothing

Adding Account Effective Steem Power

' test GetAccount_EffectiveSteemPower

Dim SteemIt
Set SteemIt = New Steem

Dim esp
esp = SteemIt.GetAccount_EffectiveSteemPower("justyy")

WScript.Echo esp
AssertTrue esp >= 20000, "justyy esp should be larger than 20000"

Set SteemIt = Nothing

Adding CreateSuggestedPassword

Dim x
Set x = New Utility

WScript.Echo x.CreateSuggestedPassword

Set x = Nothing

GetUrlFromCommentPermLink

This function returns the steem post url given a comment url

' Test GetUrlFromCommentPermLink

Dim x
Set x = New Utility

AssertEqual x.GetUrlFromCommentPermLink("re-tvb-re-justyy-re-tvb-45qr3w-20171011t144205534z"), "https://steemit.com/@tvb/45qr3w", ""

AssertEqual x.GetUrlFromCommentPermLink("re-justyy-daily-quality-cn-posts-selected-and-rewarded-promo-cn-20180520t153728557z"), "https://steemit.com/@justyy/daily-quality-cn-posts-selected-and-rewarded-promo-cn", ""

Set x = Nothing

Vests to Steem Power

Dim SteemIt
Set SteemIt = New Steem

WScript.Echo SteemIt.VestsToSp(1234234)

Set SteemIt = Nothing

Invalidate Cache

Dim SteemIt
Set SteemIt = New Steem

' fresh
WScript.Echo SteemIt.GetAccount_VotingPower("justyy")
' cached
WScript.Echo SteemIt.GetAccount_VotingPower("justyy")
' do not use cache
SteemIt.Cache = False
WScript.Echo SteemIt.GetAccount_VotingPower("justyy")

Set SteemIt = Nothing

Vests

Dim SteemIt
Set SteemIt = New Steem

WScript.Echo SteemIt.GetAccount_VestingShares("justyy")

Set SteemIt = Nothing

Delegated Vests

Dim SteemIt
Set SteemIt = New Steem

WScript.Echo SteemIt.GetAccount_DelegatedVestingShares("justyy")

Set SteemIt = Nothing

Received Vests

Dim SteemIt
Set SteemIt = New Steem

WScript.Echo SteemIt.GetAccount_ReceivedVestingShares("justyy")

Set SteemIt = Nothing

How did you implement it/them?

Commits and Docs Update

GitHub Account

https://github.com/DoctorLai


Support me and my work as a witness by

  1. voting me here, or
  2. voting me as a proxy

Some of my contributions: SteemIt Tools, Bots, APIs and Tutorial Thank you!

Sort:  

👍👍👍👍👍

Hey @justyy
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Contributing on Utopian
Learn how to contribute on our website or by watching this tutorial on Youtube.

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Nice update to your project.
You should consider using Pull Request and split your commits to have a better understanding of the work you did. In one commit you've added multiple functions, fixed some typo mistakes. You should commit one feature at a time.
Nice catch on getting the correct value of the voting power! Most people would stop at the voting_power value.

Your comments have also no value

' get account
    Public Function GetAccount(id)

You're just repeating the function name.

Good luck for your next features!

Your contribution has been evaluated according to Utopian rules and guidelines, as well as a predefined set of questions pertaining to the category.
To view those questions and the relevant answers related to your post,Click here


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Coin Marketplace

STEEM 0.27
TRX 0.13
JST 0.032
BTC 61763.08
ETH 2899.43
USDT 1.00
SBD 3.49