SHARE
TWEET

Untitled

a guest May 21st, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $explorerUrl = 'https://explorer.projectmerge.org/ext/getmasternodes';
  3. $myTxIds = ["76c727c128dc1c32df8f4e49bbc0202d1d64cf9dcc04bc44f12ff0f4f9a1cb01",
  4.     "80ec01d5cd1e247297ccc46826a8b1ce45478096b64550c789968ea9c91105f2",
  5.     "b28572a738fcef3dd98de34500567cf2e46f21b93a00fce203ed5feebf8f459e",
  6. ];
  7.  
  8. $fieldsDisplay = ["rank", "status", "version", "network", "lastseen", "activetime", "lastpaid", "txhash"];
  9. $dataContainer = [];
  10. $data = file_get_contents($explorerUrl);
  11. $data = json_decode($data, true);
  12. // Prepare Data
  13. foreach ($data['data'] as $item) {
  14.  
  15.     if (!in_array($item['txhash'], $myTxIds)) {
  16.         continue;
  17.     } else {
  18.         $dataContainer[] = $item;
  19.     }
  20.  
  21. }
  22. ?>
  23. <!DOCTYPE html>
  24. <html lang="eng">
  25.     <head>
  26.         <meta charset="UTF8">
  27.         <title>Masternode Viewer</title>
  28.         <style>
  29.         h1 {
  30.             text-align:center;
  31.         }
  32.  
  33.         #customers {
  34.             font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
  35.             border-collapse: collapse;
  36.             width: 90%;
  37.             margin-left: auto;
  38.             margin-right: auto;
  39.         }
  40.  
  41.         #customers th {
  42.             text-transform: capitalize;
  43.         }
  44.  
  45.         #customers td, #customers th {
  46.         border: 1px solid #ddd;
  47.         padding: 8px;
  48.         }
  49.  
  50.  
  51.  
  52.         #customers tr:hover {background-color: #ddd;}
  53.  
  54.         #customers th {
  55.         padding-top: 12px;
  56.         padding-bottom: 12px;
  57.         text-align: left;
  58.         background-color: #4CAF50;
  59.         color: white;
  60.         }
  61.         </style>
  62.     </head>
  63.     <body>
  64.         <h1>Masternode Viewer</h1>
  65.         <table id="customers">
  66.         <tr>
  67.             <?php
  68.             foreach ($fieldsDisplay as $key) {
  69.                 echo "<th>$key</th>\r\n";
  70.             }
  71.             ?>
  72.         </tr>
  73.             <?php
  74.             foreach ($dataContainer as $row) {
  75.                 echo "<tr>\r\n";
  76.                 foreach ($fieldsDisplay as $key) {
  77.                     echo "<td>$row[$key]</td>\r\n";
  78.                 }
  79.                 echo "</tr>\r\n";
  80.             }
  81.             ?>
  82.         </table>
  83.     </body>
  84. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top