Spaces:
Sleeping
Sleeping
| <html> | |
| <head> | |
| <title>Ticker Checker</title> | |
| <style> | |
| body { font-family: Arial; margin: 40px; } | |
| input { padding: 8px; width: 200px; } | |
| button { padding: 8px 12px; } | |
| #result { margin-top: 20px; font-size: 18px; } | |
| </style> | |
| </head> | |
| <body> | |
| <h2>Check if a Ticker Exists</h2> | |
| <input id="tickerInput" type="text" placeholder="Enter ticker (e.g., AAPL)"> | |
| <button onclick="checkTicker()">Check</button> | |
| <div id="result"></div> | |
| <script> | |
| async function checkTicker() { | |
| const ticker = document.getElementById("tickerInput").value.trim().toUpperCase(); | |
| const resultDiv = document.getElementById("result"); | |
| if (!ticker) { | |
| resultDiv.innerHTML = "Please enter a ticker."; | |
| return; | |
| } | |
| const response = await fetch(`/check/${ticker}`); | |
| const data = await response.json(); | |
| if (data.exists) { | |
| resultDiv.innerHTML = `<span style="color: green;">✔ ${ticker} exists in the dataset</span>`; | |
| } else { | |
| resultDiv.innerHTML = `<span style="color: red;">✘ ${ticker} does NOT exist in the dataset</span>`; | |
| } | |
| } | |
| </script> | |
| </body> | |
| </html> | |