SteemVBS – Adding Reputation, GetProfile, GetWitnessVotes, ValidateAccountName


vbscript SteemVBS - Adding Reputation, GetProfile, GetWitnessVotes, ValidateAccountName SteemIt VBA vbscript

vbscript

SteemVBS is the first Steem Library written in VBScript. Yes, it is VBScript. 😉

SteemVBS

VBScript is still being used nowadays, especially on windows platforms. You can do so much thing using VBScript. The aim of the SteemVBS is to provide a few useful functions that connect Network Adminstrators or MS Officer users (via VBA) to Steem Blockchain.

Fully open source: https://github.com/DoctorLai/steemvbs
Submit PR or Issue.

SteemVBS New Features

Commits: A few functions/classes and unit tests have been added in:

Formater Reputation

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Dim Format
Set Format = New Formatter
 
Const EPSILON = 1e-3
 
AssertEqualFloat Format.Reputation(95832978796820), 69.833, EPSILON, "Format.Reputation 95832978796820"
 
AssertEqualFloat Format.Reputation(10004392664120), 61.0017, EPSILON, "Format.Reputation 10004392664120"
 
AssertEqualFloat Format.Reputation(30999525306309), 65.42219, EPSILON, "Format.Reputation 30999525306309"
 
AssertEqualFloat Format.Reputation(-37765258368568), -16.193832, EPSILON, "Format.Reputation -37765258368568"
 
Set Format = Nothing
Dim Format
Set Format = New Formatter

Const EPSILON = 1e-3

AssertEqualFloat Format.Reputation(95832978796820), 69.833, EPSILON, "Format.Reputation 95832978796820"

AssertEqualFloat Format.Reputation(10004392664120), 61.0017, EPSILON, "Format.Reputation 10004392664120"

AssertEqualFloat Format.Reputation(30999525306309), 65.42219, EPSILON, "Format.Reputation 30999525306309"

AssertEqualFloat Format.Reputation(-37765258368568), -16.193832, EPSILON, "Format.Reputation -37765258368568"

Set Format = Nothing

ValidateAccountName

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
' Test ValidateAccountName
 
Dim u
Set u = New Utility
 
AssertEqual u.ValidateAccountName("justyy"), "", ""
 
AssertEqual u.ValidateAccountName("justyy**"), "Account name should have only letters, digits, or dashes.", ""
 
AssertEqual u.ValidateAccountName("a    "), "Account name should have only letters, digits, or dashes.", ""
 
AssertEqual u.ValidateAccountName("12341234"), "Account name should start with a letter.", ""
 
AssertEqual u.ValidateAccountName("  askd f"), "Account name should start with a letter.", ""
 
AssertEqual u.ValidateAccountName("-"), "Account name should be longer.", ""
 
AssertEqual u.ValidateAccountName("-aasdfasdfasdfasdfasdfasdfasdfasdf"), "Account name should be shorter.", ""
 
Set u = Nothing
' Test ValidateAccountName

Dim u
Set u = New Utility

AssertEqual u.ValidateAccountName("justyy"), "", ""

AssertEqual u.ValidateAccountName("justyy**"), "Account name should have only letters, digits, or dashes.", ""

AssertEqual u.ValidateAccountName("a    "), "Account name should have only letters, digits, or dashes.", ""

AssertEqual u.ValidateAccountName("12341234"), "Account name should start with a letter.", ""

AssertEqual u.ValidateAccountName("  askd f"), "Account name should start with a letter.", ""

AssertEqual u.ValidateAccountName("-"), "Account name should be longer.", ""

AssertEqual u.ValidateAccountName("-aasdfasdfasdfasdfasdfasdfasdfasdf"), "Account name should be shorter.", ""

Set u = Nothing

Get Profile String

1
2
3
4
Dim SteemIt
Set SteemIt = New Steem
 
WScript.Echo SteemIt.GetAccount_Profile("justyy")
Dim SteemIt
Set SteemIt = New Steem

WScript.Echo SteemIt.GetAccount_Profile("justyy")

Get Witness Votes

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
' test GetAccount_WitnessVotes
 
Dim SteemIt
Set SteemIt = New Steem
 
Dim Util
Set Util = New Utility
 
Dim witness
witness = SteemIt.GetAccount_WitnessVotes("justyy")
 
AssertTrue Util.InArray("abit", witness), "justyy should vote abit"
 
AssertTrue Util.InArray("jerrybanfield", witness), "justyy should vote jerrybanfield"
 
Set SteemIt = Nothing
Set Util = Nothing
' test GetAccount_WitnessVotes

Dim SteemIt
Set SteemIt = New Steem

Dim Util
Set Util = New Utility

Dim witness
witness = SteemIt.GetAccount_WitnessVotes("justyy")

AssertTrue Util.InArray("abit", witness), "justyy should vote abit"

AssertTrue Util.InArray("jerrybanfield", witness), "justyy should vote jerrybanfield"

Set SteemIt = Nothing
Set Util = Nothing

SteemVBS Roadmap

Most of the features of Steem-Js and Steem-Python will be brought in.

Notice

This library is under development. Beware.

Support me and my work as a witness by

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

–EOF (The Ultimate Computing & Technology Blog) —

GD Star Rating
loading...
532 words
Last Post: Tutorial - How do you convert Recursive Implementations to Iterative Approaches with Stacks?
Next Post: Introducing SteemIt Auto Claim Rewards

The Permanent URL is: SteemVBS – Adding Reputation, GetProfile, GetWitnessVotes, ValidateAccountName

Leave a Reply