sbd.ninja v0.0.2 - Add Witness Info/Vote For Functions, Add Android Release

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@bobdos·
0.000 HBD
sbd.ninja v0.0.2 - Add Witness Info/Vote For Functions, Add Android Release
# sbd.ninja v0.0.2 - Add Witness Info/Vote For Functions, Add Android Release

### Project Info
* A Cross Platform STEEM Information Query Tool (Mac/Windows/iOS/Android)
* A lot of my friends need a native tool on Mobile (iOS/Android) to query steem related information, especially outdoors or on train.

### Technology Stack 
* Lua + Corona SDK

### License
* MIT

### Build
* [sbd.ninja V0.0.2 - Mac & Windows & Android](https://www.dropbox.com/sh/k0klsh19qgbrdva/AAB36s5-QLj0Oh3bMBWpd0BNa?dl=0)
* Bug report is welcome

### Special Thanks
* Thanks to @justyy, who provides those free API for easy integration
* [https://helloacm.com/tools/steemit/](https://helloacm.com/tools/steemit/)

### New Features
* Commits is here: 
[9e39dc77f5b6588cdd155280bdaf5185e1ba9270](https://github.com/bobdos/sbd.ninja/commit/9e39dc77f5b6588cdd155280bdaf5185e1ba9270)
* Query Witness Info
![image.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1520935043/emsutskiyis7ruovlu3x.png)

```
local function queryWitnessInfo(username)

  local body = "?cached&id=" .. username

  local params = {}
  params.body = body

  network.request( "https://helloacm.com/api/steemit/witness/", 
    "POST", 
    function(event)
      if ( event.isError ) then
        print( "Network error: ", event.response )
      else
        print ( "RESPONSE: " .. event.response )
        local witnessInfo = json.decode(event.response)
        local detail = witnessInfo[1]

        -- insert info into table view
        for i = 0, #witnessInfo do
          if i == 0 then
            uiInfoTableView:insertRow({
                isCategory = true,
                params = {
                  text = username .. 
                  " - Witness Info"
                }
              })
          else
            local  rowHeight = math.ceil(display.contentHeight * 0.5 * 0.1)
            uiInfoTableView:insertRow({
                rowHeight = rowHeight, 
                params = {text = "name: " .. detail["name"]}})
            uiInfoTableView:insertRow({
                rowHeight = rowHeight, 
                params = {text = "created: " .. detail["created"]}})
            uiInfoTableView:insertRow({
                rowHeight = rowHeight, 
                params = {text = "url: " .. detail["url"]}})
            uiInfoTableView:insertRow({
                rowHeight = rowHeight, 
                params = {text = "votes: " .. detail["votes"]}})
            uiInfoTableView:insertRow({
                rowHeight = rowHeight, 
                params = {text = "running_version: " .. detail["running_version"]}})
            uiInfoTableView:insertRow({
                rowHeight = rowHeight, 
                params = {text = "total missed: " .. 
                  detail["total_missed"]}})
            uiInfoTableView:insertRow({
                rowHeight = rowHeight, 
                params = {text = "account creation fee: " .. 
                  detail["account_creation_fee"] .. " " ..
                  detail["account_creation_fee_symbol"]}})
            uiInfoTableView:insertRow({
                rowHeight = rowHeight, 
                params = {text = "maximum block size: " .. 
                  detail["maximum_block_size"]}})
            uiInfoTableView:insertRow({
                rowHeight = rowHeight, 
                params = {text = "sbd exchange rate base: " .. 
                  detail["sbd_exchange_rate_base"] .. " " ..
                  detail["sbd_exchange_rate_base_symbol"]}})
            uiInfoTableView:insertRow({
                rowHeight = rowHeight, 
                params = {text = "sbd_exchange_rate_quote: " .. 
                  detail["sbd_exchange_rate_quote"] .. " " ..
                  detail["sbd_exchange_rate_quote_symbol"]}})
            uiInfoTableView:insertRow({
                rowHeight = rowHeight, 
                params = {text = "last confirmed block num: " .. 
                  detail["last_confirmed_block_num"]}})
            uiInfoTableView:insertRow({
                rowHeight = rowHeight, 
                params = {text = "last aslot: " .. 
                  detail["last_aslot"]}})
            uiInfoTableView:insertRow({
                rowHeight = rowHeight, 
                params = {text = "signing key: " .. detail["signing_key"]}})
          end
        end

      end
    end, 
    params )

end
```

* Query Witness Vote For
![image.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1520935323/zagyvuonre7shn3ipin0.png)
```
local function queryWitnessVoteFor(username)

    local body = "?cached&id=" .. username

  local params = {}
  params.body = body

  network.request( "https://helloacm.com/api/steemit/witness_votes/", 
    "POST", 
    function(event)
      if ( event.isError ) then
        print( "Network error: ", event.response )
      else
        print ( "RESPONSE: " .. event.response )
        local witnessInfo = json.decode(event.response)
        local votes = witnessInfo[1]["witness_votes"]

        -- insert info into table view
        for i = 0, #votes do
          if i == 0 then
            uiInfoTableView:insertRow({
                isCategory = true,
                params = {
                  text = username .. 
                  " - Witness Vote For"
                }
              })
          else
            local  rowHeight = math.ceil(display.contentHeight * 0.5 * 0.1)
            uiInfoTableView:insertRow({
                rowHeight = rowHeight, 
                params = {
                  text = 
                  votes[i]
                }
              })

          end
        end

      end
    end, 
    params )
end
```

### Bug Fix
* Commits are here
* Change the widget from text box to text field, for easy usage of mobile keyboard on / off:
[bfe51388241032a122901008ea97da8c668dda88](https://github.com/bobdos/sbd.ninja/commit/bfe51388241032a122901008ea97da8c668dda88)
* Change content scale type to adaptive: [ee8de3cea56d1b11b0898a86ef977fd674bf0606](https://github.com/bobdos/sbd.ninja/commit/ee8de3cea56d1b11b0898a86ef977fd674bf0606)


### Roadmap
* Mac/Windows
* iOS/Android
* Account Information
* Delegation (In)
* Delegation (Out)
* Witness Info
* Followed/Following
* Profile
* Curation
* Converter
* Transfer History
* Votes
* More...

### Contribution is Welcome
Github: https://github.com/bobdos/sbd.ninja

* Fork it!
* Create your feature branch: git checkout -b my-new-feature
* Commit your changes: git commit -am 'Add some feature'
* Push to the branch: git push origin my-new-feature
* Submit a pull request.

   

<br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@bobdos/sbd-ninja-v0-0-2-add-witness-info-vote-for-functions-add-android-release">Utopian.io -  Rewarding Open Source Contributors</a></em><hr/>
👍 , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,