I want to make a website which gets the data from a REST API and use it to update my website asynchronously for every 10 seconds. How can I do that? I want to know the ways either for Nodejs or python.

In nodejs, I have come across socket.io but I need to create a separate file to start a server and listen to it and client which connect to the server and he will get the updates. But this is the optimized solution to this problem.

```
var express = require('express');
var router = express.Router();
var Request = require("request");

var data = "";
Request.get("https://api.thingspeak.com/channels/709694/feeds.json?api_key=MY_API_KEY&results=1",(error,response,body)=>{
    if(error){
      return console.dir(error);
    }
    data = JSON.parse(body);
});
/* GET home page. */
router.get('/', function(req, res, next) {
  res.render('index', { title: 'Patient Monitoring & Diagnostics',data:data});
});

module.exports = router;

```

The above code is Nodejs code. I want to run the `Request.get()` for every 10 seconds and update the webpage without refreshing it.