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.0
Roadmap
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
You just need to git clone the project and reference the unit
require('class.utopian.php');
$utopian = new Utopian();
$moderators = $utopian->GetModerators()
if ($utopian->IsModerator('justyy')) echo "Hello, yes!";
if ($utopian->IsSponsor('justyy')) echo "Hello, i am sponsor!";
print_r($utopian->GetSponsors());
foreach ($utopian->GetPosts() as $post) {
// do something about $post;
}
$flagged_posts = $utopian->GetPosts(array("status" => "flagged"));
echo "Total approved: " . $utopian->GetCount();
var_dump($utopian->GetPost('justyy', 'string-contains-test-cannot-be-added-to-the-post'));
if ($utopian->IsBotVoting()) {
// ok write a post
}
The unit tests framework is phpunit and you can run tests via command phpunit