Spaces:
Running
Running
Download index.html from greyexploiter/icmr-api-worker: direct link, hf CLI and curl.
- Browser
- Download file 2.12 kB
-
https://huggingface.co/spaces/greyexploiter/icmr-api-worker/resolve/main/index.html
- Command line
-
hf download hf://spaces/greyexploiter/icmr-api-worker/index.html
-
curl -L -o index.html https://huggingface.co/spaces/greyexploiter/icmr-api-worker/resolve/main/index.html
2.12 kB
| <!-- language: HTML, file: index.html, target: Hugging Face Static Space --> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>ICMR Record Lookup</title> | |
| <style> | |
| body { background: #0f172a; color: #f8fafc; font-family: monospace; padding: 40px; } | |
| input, select, button { background: #1e293b; color: #fff; border: 1px solid #334155; padding: 10px; margin: 5px 0; font-family: monospace; } | |
| button { cursor: pointer; background: #3b82f6; border: none; } | |
| pre { background: #1e293b; padding: 15px; border-radius: 5px; overflow-x: auto; max-height: 400px; } | |
| </style> | |
| </head> | |
| <body> | |
| <h2>ICMR Record Lookup</h2> | |
| <div> | |
| <select id="type"> | |
| <option value="phone">Phone Number</option> | |
| <option value="aadhar">Identifier / Aadhaar</option> | |
| </select> | |
| <input type="text" id="query" placeholder="Enter query value..." style="width: 300px;"> | |
| <button onclick="searchData()">Search</button> | |
| </div> | |
| <pre id="output">Engine ready. Select type and enter a value to search.</pre> | |
| <script> | |
| async function searchData() { | |
| const type = document.getElementById('type').value; | |
| const val = document.getElementById('query').value.trim(); | |
| if (!val) return alert("Enter a search value"); | |
| document.getElementById('output').innerText = "Querying records..."; | |
| try { | |
| // Direct lookup handling using standard fetch | |
| const endpoint = type === 'phone' ? '/api/icmr/phone' : '/api/icmr/aadhar'; | |
| const param = type === 'phone' ? 'mobile' : 'aadhar'; | |
| const res = await fetch(`https://phisherjr-worker.hf.space${endpoint}?${param}=${encodeURIComponent(val)}`); | |
| const data = await res.json(); | |
| document.getElementById('output').innerText = JSON.stringify(data, null, 2); | |
| } catch (err) { | |
| document.getElementById('output').innerText = "Query Error: " + err.message; | |
| } | |
| } | |
| </script> | |
| </body> | |
| </html> |