skip to Main Content

I’m using wp-get api plugin to call an open rest-api , data returned by that api is changing continously , i also want to show that live data , without calling api or reloading the page .

<div class="box"  id="heart">
  <div class="glass"></div>
    <div class="content">
      <h1><?php
              $data = wpgetapi_endpoint( 'yahoo', 'yahoo', array('debug' => false) );
              $result = intval($data["tabsOpened"]/15);
              echo $result;
            ?> 
        </h1> 
        <p>Food Plates Donated</p>  
     <h1><?php
              $data = wpgetapi_endpoint( 'yahoo', 'yahoo', array('debug' => false) );
              $result = intval($data["tabsOpened"]);
              echo $result;
            ?> 
        </h1> 
        <p>Tabs Opened</p>  
  </div>
</div>

i’m showing the data in heart, i want to update the values like a counter . how can i achieve this .

enter image description here

2

Answers


Please signup or login to give your own answer.
Back To Top
Search