Adding Sponsors Class to PHP Client of Utopian API

in #utopian-io7 years ago (edited)

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.

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.0

  • Roadmap
    The next release will be adding more unit tests and more other advance API wrappers such as statistics helpers.

  • How to contribute?
    Github: https://github.com/DoctorLai/utopian-api-php-client

    1. Fork it!
    2. Create your feature branch: git checkout -b my-new-feature
    3. Commit your changes: git commit -am 'Add some feature'
    4. Push to the branch: git push origin my-new-feature
    5. Submit a pull request :D

This Commits

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;
}



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]

Hey @helo, I just gave you a tip for your hard work on moderation. Upvote this comment to support the utopian moderators and increase your future rewards!

Verry good

Hey @justyy I am @utopian-io. I have just upvoted you!

Achievements

  • 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