<?php
require 'includes/ProxyHelper.php';
$h = new ProxyHelper();

$res = $h->fetch('https://bdris.gov.bd/js/util.js', 'GET', [], false, 'https://bdris.gov.bd/admin/br/search');
echo "HTTP STATUS: " . $res['status'] . "\n";

$body = $res['body'];
if (empty($body)) {
    die("Empty body\n");
}

// Search for any NID related code or AJAX calls
$lines = explode("\n", $body);
foreach ($lines as $idx => $line) {
    if (stripos($line, 'nid') !== false || stripos($line, 'getPersonInfo') !== false) {
        echo ($idx + 1) . ": " . trim($line) . "\n";
    }
}
