STEEM-Bash

in #utopian-io7 years ago (edited)

New Project

  • What is the project about?
    This is a project to create a useful set of functions that can be used in Bash scripts to allow accessing the STEEM blockchain.

  • Technology Stack
    This project makes use of only the most common Unix utilities (wget, grep, cut, etc) to fetch and manipulate content from the STEEM blockchain for use in Bash scripts. The current features include fetching user profiles, fetching specific data from those profiles, and calculating the worth of a user's wallet in USD. This calculation uses values from cryptocompare, steemd, and steemit.com.

The intent is that it will be possible to build other tools and make use of elements from STEEM in shell scripts. The currently implemented example script is for fetching the USD value of a given steem wallet provided any account user name. This information could be used in the users's shell prompt, tmux, screen, conky, or other commonly used utility that can slurp up and make use of data from bash scripts.

Using

Currently the only exposed functionality is the script for fetching a given
user's wallet value from the command line. It can be invoked thusly:

worth.sh [account-name]

And it will produce the value in USD for the specified account name.

For example:

$ worth.sh not-a-bird
1577.120

Additional Functionality

The project is organized as a single functions.sh script that can be sourced
from other scripts, and then the functions within it can be invoked directly.

Current functionality:

  • get_profile
    Gets the specified users' profile as JSON.

  • get_bank
    Gets the value of the specified user's wallet, including STEEM, SP, SBD, and
    savings (but not delegations, since these aren't owned by the user).

  • get_steem_per_mvest
    Gets the current rate in STEEM for each million vesting shares. This is useful
    in computing the SP for a given user.

Requirements

Uses the following programs in addition to Bash:

  • bc
  • grep
  • jq
  • wget
  • zcat

Roadmap

Over the new few weeks I plan to create example scripts for:

  • building graphical menus to integrate with FVWM for
    • displaying account value
    • reading steem posts
  • reading posts at the CLI
  • fetching followed users
  • building graphs with graphviz
  • enabling other experiments under Bash
  • JSON RPC calls from bash for other Steem functionality

I'm an avid user of the command line and the FVWM window manager. I fully intend to create scripts that integrate basic STEEM blockchain read access into my window menus and various console status indicators. But these scripts will also make it possible to perform ad-hoc experiments, such as fetching followers/followees, memos, and even experimenting with new weighting methods for listing posts.

  • How to contribute?
    If this project seems even slightly interesting and you'd like to contribute you can fork it on github, you can contact me via Discord (not-a-bird on Utopian's Discord server), or even contact me through steemit.chat or on the Steem platform by leaving me a comment or tiny transfer with an attached memo. Sorry, I don't use any other social networks.

If you have a mac and can test the initial scripts, that would be a great place to start.

  • Github Location is here



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

JSON RPC calls from bash for other Steem funcationality

That's an odd typo.

I want in on this. How soon until you have some RPC functions so I can use these in my scripts?

Eh. One letter...

I have a local branch on my system that's not quite ready for prime time yet. I've got a basic function for doing RPC calls and I've been adding in all of the ones that came back when I got an invalid method invocation exception. At least, I'm adding in the ones that I can figure out how to use. I'm double checking the names against the Steem Python docs, some of them don't seem to work, but the ones that are working I'm putting in. Give me another day and I'll have something you can start scripting against. The error handling isn't really there, but for the happy path they're quite happy.

On the README, you stated:

*Mac

I need testers! The functions and script have only been tested on Ubuntu 17.10. Hypothetically it should work on other Linux and Unix flavors. I can create VMs for testing everything but Mac.*

I am forced to use a Mac for work so I would be willing to do some testing on the Mac if that still would be of use to you.

That would be very helpful!

Let me know how it goes and I can update the scripts to make them better.

Do you know if jq is available on a Mac by default? It's far from standard bash and kind of violates my initial desire to stick as close to bash as possible, but it does a lot of helpful heavy lifting...

Loading...

Does the utopian interface provide a link in its interface? Cuz I dont see one here on steemit.....

Edit, maybe this one? https://github.com/not-a-bird/steem-bash

Yup, that's the one.

When posting about a project like this a link would be a good idea.

Sorry, I'm a bit naive on the workings of utopian stuff. I just assumed that since I had to pick a project as a part of the submission process that it would somehow include a link.

I have no idea about Utopian-io stuff, but what good is reading about a project if id don't know where to find find it?

I mean, I could google it... but that takes effort.

And thank you for adding a link.

Yeah, it was a huge oversight on my part. It didn't even occur to me that it might be a problem until I was away from the computer that has my keys, so I had to wait until the end of the day to get home and fix it.

Thank you for the contribution. It has been approved.

The readme is clear, the license is present, the userid is evident, the code is original.

I was able to test both functions that you have built.

I'm looking forward to more development on this project.

Try to include at least one image per post if applicable.

You can contact us on Discord.
[utopian-moderator]

Hey @not-a-bird I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

checkout this link I believe this will be a useful link to this post.

I wholeheartedly disagree.

Coin Marketplace

STEEM 0.21
TRX 0.13
JST 0.030
BTC 67096.35
ETH 3509.27
USDT 1.00
SBD 3.22