prsurve

Untitled

Jan 1st, 2022
1,229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 2.42 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.  
  5.  
  6. Symbol
  7. <br>
  8. <input type="text" id="symbol" value="">
  9. <br>
  10. <br>
  11. From Date
  12. <br>
  13. <input type="datetime-local" id="from-date" value="">
  14. <br>
  15. <br>
  16. To Date
  17. <br>
  18. <input type="datetime-local" id="to-date" value="">
  19.  
  20. <br>
  21. <br>
  22. <button onclick="myFunction()">Try it</button>
  23.  
  24. <p id="demo1"></p>
  25.  
  26. <script>
  27. // function request_data(){
  28.  
  29. // var requestOptions = {
  30. // method: 'GET',
  31. // mode: 'no-cors'
  32. // };
  33.  
  34. //  fetch("https://tvc4.investing.com/78c640d7b00dd34b4e5961c0de0aac63/1640931544/1/1/8/history?limit=3000&query=infy&type=&exchange=&resolution=1&from=1640843702&to=1640930102", requestOptions)
  35. // .then((response) => {
  36. //     return response.text();
  37. //   })
  38. // .then(result => console.log(result))
  39. // .catch(error => console.log('error', error));
  40.  
  41. // //  fetch('',requestOptions)
  42. // //                 .then(response => response.text());
  43. // // return "jsons";
  44. // }
  45. function myFunction() {
  46. //   var a = document.getElementById("symbol").value;
  47. //   document.getElementById("demo").innerHTML = a;
  48.   var x = document.getElementById("from-date").value;
  49.   document.getElementById("demo1").innerHTML = tests();
  50.  
  51.  
  52.  
  53. }
  54.  
  55. function tests(){
  56.  
  57.     fetch("https://tvc4.investing.com/78c640d7b00dd34b4e5961c0de0aac63/1640931544/1/1/8/history?limit=3000&query=infy&type=&exchange=&resolution=1&from=1640843702&to=1640930102", {
  58.  "headers": {
  59.    "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
  60.     "accept-language": "en-IN,en-US;q=0.9,en-GB;q=0.8,en;q=0.7",
  61.     "cache-control": "max-age=0",
  62.     "sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"96\", \"Google Chrome\";v=\"96\"",
  63.     "sec-ch-ua-mobile": "?0",
  64.     "sec-ch-ua-platform": "\"Linux\"",
  65.     "sec-fetch-dest": "document",
  66.     "sec-fetch-mode": "navigate",
  67.     "sec-fetch-site": "none",
  68.     "sec-fetch-user": "?1",
  69.     "upgrade-insecure-requests": "1"
  70.   },
  71.   "referrerPolicy": "strict-origin-when-cross-origin",
  72.   "body": null,
  73.   "method": "GET",
  74.   "mode": "no-cors",
  75.   "credentials": "include"
  76. })
  77. .then((response) => {
  78.     return response.text();
  79.   })
  80. .then(result => console.log(result))
  81. .catch(error => console.log('error', error));
  82. }
  83.  
  84.  
  85. function uuid(){
  86.     var u = URL.createObjectURL(new Blob([""]))
  87.     URL.revokeObjectURL(u);
  88.     return u.split("/").slice(-1)[0]
  89. }
  90. </script>
  91.  
  92. </body>
  93. </html>
  94.  
Advertisement
Add Comment
Please, Sign In to add comment