Introducing Steem Api Tools - A Collection Of PHP Tools For Interacting With The Steem Blockchain

in #steemit7 years ago

As a programmer who has been a beta tester for PHP version 3.0, back in early 2000s, I have to confess that the first love is never forget. Or that the first cut is the deepest - you know what I mean. I wrote tens of thousands of lines of PHP code and I'm still very familiar with it.

On top of that, PHP is still one of the most popular languages out there, definitely the number one choice when it comes to web programming, so there is still a fairly big number of skilled PHP programmers out there (if you don't believe me, just do a search for "job php programmer" on StackOverflow).

So when I started to code steem.supply, PHP was my first choice. I was surprised that there wasn't a lot of supporting code written in PHP, so I ended up putting together a few bits and pieces published by @lukestokes and then building on top if it, by creating a CodeIgniter project. You know what followed: steem.supply became a very popular service on the Steemit ecosystem (to my surprise, but also delight, to be honest).

At some point during development I realized I was dealing with a huge pile of spaghetti code, even if the MVC pattern of CodeIgniter forced me to keep a certain discipline. I decided that I will separate the generic blockchain functions from the application logic and put them together in a separate package. As always, though, life got in the way, so I only found out a few hours to do this today.

What you will find in this GitHub repository is by no means a production-ready package, but more of a log of what I'm using and a foundation for a future, modular and simple PHP library that will hopefully open the Steem blockchain to a huge number of programmers out there. So don't expect it to work or to do anything useful other than just calling the blockchain, but do read it and try to understand how it works. Also, if you want to contribute, you're free to do it, just fork it, write your feature and then submit a pull request.

Basic Features

As it is right now, the Steem Api Tools consists of two classes: SteemLayer and SteemApi. SteemLayer is responsible for making the calls, and it uses both cURL and websocket(via an external dependency) to do this. It also has some basic debugging and configuration settings. SteemApi maps a few of the Steem blockchain apis (some of them a bit more complex than others) and has a couple of generic functions for getting the price of STEEM from coinmarketcap.

Installation can be done via composer:

composer require dragos-roua/steem-api-tools

or by cloning the GitHub repository.

There are plans for continuous integration via Travis and obviously the package can be found on Packagist.

I will continue to update the package and to monitor contributions (if any) and when I'll consider it ready for production, I will make a public announcement.

Until then, we're starting at version 0.0.1-alpha.

Steem on!


I'm a serial entrepreneur, blogger and ultrarunner. You can find me mainly on my blog at Dragos Roua where I write about productivity, business, relationships and running. Here on Steemit you may stay updated by following me @dragosroua.


Dragos Roua


You can also vote for me as witness here:
https://steemit.com/~witnesses


If you're new to Steemit, you may find these articles relevant (that's also part of my witness activity to support new members of the platform):

Sort:  

Great initiative. If I had time, I'd get back into it. PHP packs a lot of power in its punch.

steem.supply, and steemnow is great tools to help all steemians

Great post. I am in IT but not a programmer.. I wish I could.. I have so many nice idea's.. In case you are interested we could talk about it on steem chat. keep on going with steem.supply I love it..

I love steem.supply I use it Daily and have passed the link on to many of my followers so they can too.

Good! Thanks for sharing I will take a look and maybe I could help :)

You're welcome :)

Great post.Good achive my friend.Go ahead.

nice sharing good psot i like it i Follow you please vote me thank you so much i need your help ..

Congratulations @dragosroua! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

You published 4 posts in one day

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

that's more technical to me looks like i need to learn some programming

Coin Marketplace

STEEM 0.16
TRX 0.16
JST 0.030
BTC 59358.13
ETH 2471.72
USDT 1.00
SBD 2.45