Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. function eth_accountAmount(){
  2. $request = wp_remote_get('https://api.etherscan.io/api?module=account&action=balance&address=0xddbd2b932c763ba5b1b7ae3b362eac3e8d40121a&tag=latest&apikey=VYTX1PQH4C1AF5DV7J57CRFQ9ARUDNJ3MX/');
  3. if (is_wp_error($request))
  4. {
  5. return false; // Bail early
  6. }
  7.  
  8. $body = wp_remote_retrieve_body($request);
  9. $data = json_decode($body);
  10. foreach($data->result as $result);
  11. $result = $result / 1000000000000000000;
  12.  
  13. echo $result;
  14. }
  15.  
  16.  
  17. add_shortcode('eth_account_Amount', 'eth_accountAmount');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement