-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget-data.php
More file actions
37 lines (28 loc) · 976 Bytes
/
get-data.php
File metadata and controls
37 lines (28 loc) · 976 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
include_once __DIR__ . '/env.php';
$url = 'http://api.bsod.pw/api/wallet?address=';
$currencies_url = 'http://api.bsod.pw/api/currencies';
// Call the url and ask for currencies data
$result_currencies = file_get_contents($currencies_url);
// Parse the result as a JSON
$obj_currencies = json_decode($result_currencies);
// Filter the results for RVN
foreach ($obj_currencies as $currency){
if ($currency->symbol == 'RVN'){
$rvn = $currency;
}
};
// Query for the Miner data, with wallet ID
$result_miner = file_get_contents($url . $wallet_id);
// Parse as a JSON
$obj_miner = json_decode($result_miner);
// Create a custom OBJ with filtered infos
$ravenconin_Rvn = array(
"crypto" => $rvn->name,
"symbol" => $rvn->symbol,
"estimate" => $rvn->estimate,
"paid24" => $obj_miner->paid24h,
"unpaid" => $obj_miner->unpaid,
"total" => $obj_miner->total,
);
var_dump($ravenconin_Rvn);