Advertisement
Guest User

Untitled

a guest
Jul 29th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.  
  5. <h1>The template Tag</h1>
  6.  
  7. <p>Content inside a template tag is hidden from the client.</p>
  8. <p id="demo"></p>
  9. <script>
  10. var https = require("https");
  11.  
  12. var username = "fd485fdbaac0a28bf78d039c015f053d";
  13. var password = "";
  14. var auth = "Basic " + new Buffer(username + ':' + password).toString('base64');
  15.  
  16. var request = https.request({
  17. method: "POST",
  18. host: "api.intrinio.com",
  19. path: "/data_point?identifier=FB&item=close_price",
  20. headers: {
  21. "Authorization": auth
  22. }
  23. }, function(response) {
  24. var json = "";
  25. response.on('data', function (chunk) {
  26. json += chunk;
  27. });
  28. response.on('end', function() {
  29. var company = JSON.parse(json);
  30. console.log(company.value);
  31. document.getElementById("demo").innerHTML = company.value;
  32. });
  33. });
  34.  
  35. request.end();
  36. </script>
  37.  
  38. </body>
  39. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement