PHP Client of Utopian API
What is the project about?
The project is to wrap the public utopian APIs in PHP Class. I have seen @emrebeyler 's contribution on Python client, so I think it is a good idea to provide a PHP implementation.Technology Stack
PHP 7.0Roadmap
The next release will be adding more unit tests and more about moderators in terms of rewards, payout etc.How to contribute?
Github: https://github.com/DoctorLai/utopian-api-php-client- 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
Installation and Usage
You just need to git clone
the project and reference the unit
require('class.utopian.php');
Creating Instance
$utopian = new Utopian();
Getting a list of moderators
$moderators = $utopian->GetModerators()
Check if account is moderator type
if ($utopian->IsModerator('justyy')) echo "Hello, yes!";
Check if account is sponsor type
if ($utopian->IsSponsor('justyy')) echo "Hello, i am sponsor!";
Get List of Sponsors
print_r($utopian->GetSponsors());
Get Approved posts
foreach ($utopian->GetPosts() as $post) {
// do something about $post;
}
Get a list of Hidden Posts
$flagged_posts = $utopian->GetPosts(array("status" => "flagged"));
Get count of approved contribution
echo "Total approved: " . $utopian->GetCount();
Get Post detail
var_dump($utopian->GetPost('justyy', 'string-contains-test-cannot-be-added-to-the-post'));
Check if bot is voting
if ($utopian->IsBotVoting()) {
// ok write a post
}
Unit Tests
The unit tests framework is phpunit and you can run tests via command phpunit
Posted on Utopian.io - Rewarding Open Source Contributors
Upvote please
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I haven't really get into utopian work. So far what i know is, it is good to the person who know programming. Rewards is actually awesome.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I dont about utopian, but I think so is very interesting.
For you @justyy, thanks for you support some my post.
Im very glad.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thank you for the contribution. It has been approved.
Great Work with the client.
You can contact us on Discord.
[utopian-moderator]
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thank you!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Hey @justyy I am @utopian-io. I have just upvoted you!
Achievements
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
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
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit