Steemit Pending Payouts Checker PHP

in #utopian-io7 years ago

Hello there

Today I am making up for introducing a project I wrote for Steemit.

To briefly explain the purpose of the project:
A web project that shows your account's pending payments.

You can see the total amount to be paid with this project written with SteemJS Api support.

So you will not have to constantly calculate.

I think this project using PHP and HTML will be of great benefit to Steemit users.


There are 3 files in the project.

3.png

-index.php

-result.php

-logo.png


https://github.com/oguzdelioglu/Steemit-Pending-Payouts-Checker-PHP


Index.php

The form page used to enter the user data the user wants to query.

1.png


result.php


The results page showing the user's outstanding payments using the SteemJS API system.

2.png


logo.png


The Steemit Platform's Logo.

Codes

Index.php

<html>
<body>
<center>
<img width="400" height="200" src="logo.png" alt="Steemit">
<form action="result.php">
  Your Steemit Account Name<br>
  <input type="text" style="text-align:center;" name="username" value="odl">
  <br> <br>
  <input type="submit" value="Check Pending Payouts">
</form> 
</center>
</body>
</html>

Result.php

<?php
$username = $_GET["username"];
$url = 'https://api.steemjs.com/get_discussions_by_blog?query={"tag":"'.$username.'","limit":"100"}';
$json= file_get_contents($url);
$data = json_decode($json,true);
echo '<style>
a {
  text-decoration:none;
}
a:visited {
    color: darkgreen;
}
</style>';

echo '<body link="darkgreen">';
echo '<meta name="viewport" content="width=device-width, initial-scale=1">';
echo '<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">';
echo '<center><a href="index.php">
<img border="0" alt="Steemit" src="logo.png" width="400" height="200">
</a></center>';
echo '<div class="w3-container">';
echo '<table class="w3-table w3-striped w3-border" align="center">';
$total_price = 0;
foreach ($data as $item) {
    try
    {
        if(!($item["pending_payout_value"]=="0.000 SBD"))
        {
            echo "<tr>";
            $post_link = "https://www.steemit.com/@".$item["author"]."/".$item["permlink"];
            $post_title = $item["title"];
            $price = str_replace(" SBD", "", $item["pending_payout_value"]);
            $total_price = $total_price + $price;
            echo '<td><a target="_BLANK" href="'.$post_link.'"/>'.$post_title.'</td> <td>'.$item["pending_payout_value"].'</td>';
            echo "</tr>";
            wait(0.1);
        }
    }
    catch(Exception $e)
    {
    }
}
echo '<center>Total SBD:'.$total_price.'</center>';
echo '</table>';
echo '</div>';
echo '</body>';

function wait($time)
{
    usleep(1000000*$time);
    ob_flush();
    flush();
}
?>

If you have ideas or suggestions about the project, you can specify it as a comment.



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

I really need this. I am new and I don't even really know how to calculate future payments, so an app that doesn't for me is helpful.

Good job! Keep up the good work!

This is an awesome project that will go many places. Perhaps writing it in different languages such as python would be nice

Nice post..
I want to learn from you.
I wish

Congratulations @odl! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the total payout received

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

Congratulations, you have received a free upvote from @bonds!

Bonds offers a hedge against volatility as well as paid upvote and reSTEEM services.

Bonds is not a bot- this is run by humans, for humans.

Check out our #introduceyourself post to find- out more- if you like the idea, like or reSTEEM it, and we all benefit.

Happy STEEMing!

Great post. A small suggestion is could you please add comments your PHP code to let others know whats's going on and what each piece of code is doing. Helps with newbies to PHP and in debugging . Cheers!

Thank you for the contribution. It has been approved.

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

Thank you for sharing this. Maybe you should check out steem.supply. They offer this service already.

thanks for sharing

Coin Marketplace

STEEM 0.27
TRX 0.20
JST 0.039
BTC 97468.81
ETH 3593.60
USDT 1.00
SBD 3.89