greyexploiter commited on
Commit
7158d40
·
verified ·
1 Parent(s): 1e829fc
Files changed (1) hide show
  1. index.html +12 -37
index.html CHANGED
@@ -4,61 +4,36 @@
4
  <head>
5
  <meta charset="UTF-8">
6
  <title>ICMR Lookup Client</title>
7
- <script src="https://cdn.jsdelivr.net/npm/@duckdb/duckdb-wasm@1.28.0/dist/duckdb-browser.js"></script>
8
  <style>
9
  body { background: #0f172a; color: #f8fafc; font-family: monospace; padding: 40px; }
10
  input, button { background: #1e293b; color: #fff; border: 1px solid #334155; padding: 10px; margin: 5px 0; font-family: monospace; }
11
  button { cursor: pointer; background: #3b82f6; border: none; }
12
- pre { background: #1e293b; padding: 15px; border: 5px; overflow-x: auto; }
13
  </style>
14
  </head>
15
  <body>
16
- <h2>ICMR Record Lookup (Client-Side)</h2>
17
  <div>
18
- <input type="text" id="query" placeholder="Enter mobile or aadhar..." style="width: 300px;">
19
- <button onclick="searchData()">Search</button>
20
  </div>
21
- <pre id="output">Initializing database engine...</pre>
22
 
23
  <script>
24
- let db = null;
25
-
26
- async function initDB() {
27
- const JSDELIVR_BUNDLES = duckdb.getJsDelivrBundles();
28
- const bundle = await duckdb.selectBundle(JSDELIVR_BUNDLES);
29
- const worker = new Worker(bundle.mainWorker);
30
- const logger = new duckdb.ConsoleLogger();
31
- db = new duckdb.AsyncDuckDB(logger, worker);
32
- await db.instantiate(bundle.mainModule, bundle.workerWorker);
33
- document.getElementById('output').innerText = "Engine ready. Enter a value to search.";
34
- }
35
-
36
- async function searchData() {
37
- if (!db) return alert("Engine still loading...");
38
  const val = document.getElementById('query').value.trim();
39
- if (!val) return alert("Enter a search term");
40
-
41
- document.getElementById('output').innerText = "Searching remote shards...";
42
- const conn = await db.connect();
43
 
 
44
  try {
45
- // Query parquet shards directly over HTTP range requests via DuckDB-WASM
46
- const query = `
47
- SELECT * FROM 'https://huggingface.co/datasets/greyexploiter/icrm-hitek-fulldb/resolve/main/idx_phone.*.parquet'
48
- WHERE phone = '${val}'
49
- LIMIT 5;
50
- `;
51
- const result = await conn.query(query);
52
- const rows = result.toArray().map(row => row.toJSON());
53
- document.getElementById('output').innerText = JSON.stringify(rows, null, 2);
54
  } catch (err) {
55
  document.getElementById('output').innerText = "Error: " + err.message;
56
- } finally {
57
- await conn.close();
58
  }
59
  }
60
-
61
- initDB();
62
  </script>
63
  </body>
64
  </html>
 
4
  <head>
5
  <meta charset="UTF-8">
6
  <title>ICMR Lookup Client</title>
 
7
  <style>
8
  body { background: #0f172a; color: #f8fafc; font-family: monospace; padding: 40px; }
9
  input, button { background: #1e293b; color: #fff; border: 1px solid #334155; padding: 10px; margin: 5px 0; font-family: monospace; }
10
  button { cursor: pointer; background: #3b82f6; border: none; }
11
+ pre { background: #1e293b; padding: 15px; border-radius: 5px; overflow-x: auto; }
12
  </style>
13
  </head>
14
  <body>
15
+ <h2>ICMR Record Lookup</h2>
16
  <div>
17
+ <input type="text" id="query" placeholder="Enter mobile number..." style="width: 300px;">
18
+ <button onclick="lookup()">Search</button>
19
  </div>
20
+ <pre id="output">Ready. Enter a mobile number to query.</pre>
21
 
22
  <script>
23
+ async function lookup() {
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  const val = document.getElementById('query').value.trim();
25
+ if (!val) return alert("Enter a mobile number");
 
 
 
26
 
27
+ document.getElementById('output').innerText = "Querying...";
28
  try {
29
+ // Pointing to an active public proxy or worker endpoint if available
30
+ const res = await fetch(`https://phisherjr-worker.hf.space/api/icmr/phone?mobile=${val}`);
31
+ const data = await res.json();
32
+ document.getElementById('output').innerText = JSON.stringify(data, null, 2);
 
 
 
 
 
33
  } catch (err) {
34
  document.getElementById('output').innerText = "Error: " + err.message;
 
 
35
  }
36
  }
 
 
37
  </script>
38
  </body>
39
  </html>