PHP Client of Utopian API - add posts class and bug fixes

in #utopian-io6 years ago (edited)

uap-1.png

Bug Fixes

With PR#2, I updated the readme with install and test commands. This will help other who want to use or develop for the client.

uap-2.png

I fixed moderator class by checking if the property 'total_paid_rewards' exists and it also seems that GetCategory() cannot have no arguments, so I gave it one with some clever little code.

uap-3.png

With PR#3, I fixed a serious inverted parameters of the CallAPI function and corrected the GET implementation of the CallAPI function as well. I also removed the code that was nullifying the params string of my getPosts function.

New Features

With PR#4, I implemented the posts class and in a way this is why I was discovering the bugs above.

Here is some code on how to use it:

require('class.posts.php');
$posts = new Posts();

$data = $posts->GetPosts('limit=10&moderator=helo&sortBy=created');
print_r($data);

$data = $posts->GetTotal();
print_r($data);

$data = $posts->GetList();
print_r($data);

$data = $posts->GetPost('helo','php-client-of-utopian-api-add-composer-and-fix-unit-tests');
print_r($data);

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 :D



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

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

It helped me too

Thanks for your contribution!

i enjoy your post! thanks

Hey @helo 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

Coin Marketplace

STEEM 0.30
TRX 0.12
JST 0.033
BTC 64222.08
ETH 3135.29
USDT 1.00
SBD 3.99