The project PHP Client of Utopian API wraps the Utopian APIs and yesterday, the sub class Moderators has been added to the project, see Adding Moderator Class to PHP Client of Utopian API. Today, Sponsors have been added to the project so it is now very convenient to know, with a few lines of code, for example, the list of sponsors that are also witnesses or who opt-out receiving steem payout.
Github: PHP Client of Utopian API
Reload the Data (Sponsors)
This will re-fetch the data from Utopian API.
$sponsors->Reload();
Raw Data (Sponsors)
$sponsors->GetRawData();
Get a list of Sponsors
print_r($sponsors->GetList());
Get Total Number of sponsors
echo "there are " . $sponsors->GetTotal() . " sponsors.";
Find a Sponsor
$ned = $sponsors->GetSponsor('ned');
print_r($ned);
Get Total Paid Rewards
echo "Total Paid Rewards: " . $sponsors->GetTotalPaidRewards();
Get Total of should_receive_rewards
echo "Should Receive Total: " . $sponsors->GetShouldReceiveRewards();
Get Total Sum of total_paid_rewards_steem
echo "Steem: " . $sponsors->GetTotalPaidRewardsSteem();
Get Total Vesting by all sponsors
echo "Total Vesting by all sponsors: " . $sponsors->GetTotalVesting();
Get a list of Witnesses
foreach ($sponsors->GetListOfWitness() as $acc) {
echo "Witness: " . $acc;
}
Get Total of paid-rewards-steem
echo "Total Paid Rewards Steem: " . $sponsors->GetTotalPaidRewardsSteem();
Get a list of Opted-out sponsors
foreach ($sponsors->GetListOfOptedOutSponsors() as $acc) {
echo "Opted_out: " . $acc;
}
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 😀
Unit Tests
The unit tests framework is phpunit and you can run tests via command phpunit.
–EOF (The Ultimate Computing & Technology Blog) —
459 wordsLast Post: Adding Moderators Class to PHP Client of Utopian API
Next Post: How to Write Chrome Bookmark Scripts? - Step by Step Tutorial with a SteemIt Example