Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <body>
- <h1>The template Tag</h1>
- <p>Content inside a template tag is hidden from the client.</p>
- <p id="demo"></p>
- <script>
- var https = require("https");
- var username = "fd485fdbaac0a28bf78d039c015f053d";
- var password = "";
- var auth = "Basic " + new Buffer(username + ':' + password).toString('base64');
- var request = https.request({
- method: "POST",
- host: "api.intrinio.com",
- path: "/data_point?identifier=FB&item=close_price",
- headers: {
- "Authorization": auth
- }
- }, function(response) {
- var json = "";
- response.on('data', function (chunk) {
- json += chunk;
- });
- response.on('end', function() {
- var company = JSON.parse(json);
- console.log(company.value);
- document.getElementById("demo").innerHTML = company.value;
- });
- });
- request.end();
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement