File manager - Edit - /home/cipherteam/htdocs/cipherteam.in/APPS/CronJobs/cameoindia/cameoindia.php
Back
<?php include("simple_html_dom.php"); /* ---------------- DB CONNECTION ---------------- */ $con = mysqli_connect("localhost:3306", "marketdatauser", "d7o7A8%s2d7", "marketdataci"); if (mysqli_connect_errno()) { echo "Connection Fail " . mysqli_connect_error(); exit; } mysqli_set_charset($con, "utf8mb4"); /* ---------------- Helper: split comma-separated names ---------------- */ function splitIpoNames($raw) { $parts = preg_split('/\s*,\s*/', trim((string)$raw)); $out = []; foreach ($parts as $p) { $p = trim($p); if ($p !== '') $out[] = $p; } return array_values(array_unique($out)); } /* ---------------- Get IPO Names ONLY for CameoIndia ---------------- IMPORTANT: ensure this matches your scraper_servers.server_name value. If you store as "Cameo India", change below to that exact text. */ $res = mysqli_query($con, " SELECT ipo_name FROM scraper_servers WHERE is_enabled = 1 AND server_name = 'CameoIndia' AND ipo_name <> '' "); $ipoNames = []; while ($row = mysqli_fetch_assoc($res)) { foreach (splitIpoNames($row['ipo_name']) as $nm) { $ipoNames[] = $nm; } } $ipoNames = array_values(array_unique($ipoNames)); if (empty($ipoNames)) { echo "No CameoIndia IPO names found.\n"; exit(0); } /* ---------------- Fetch Cameo page once ---------------- */ $html = file_get_html("https://ipostatus1.cameoindia.com/"); if (!$html) { echo "Failed to load CameoIndia page.\n"; exit(0); } /* ---------------- Dropdown: drpCompany ---------------- */ $list = $html->find('select[id=drpCompany]', 0); if (!$list) { echo "Company dropdown not found on CameoIndia page.\n"; exit(0); } /* ---------------- Extract dropdown options ---------------- */ $options = []; foreach ($list->find('option') as $opt) { $txt = trim($opt->plaintext); if ($txt !== '' && stripos($txt, 'select') === false) { $options[] = $txt; } } /* ---------------- Check each IPO name ---------------- */ $foundCount = 0; foreach ($ipoNames as $name) { foreach ($options as $optText) { if (strpos(strtolower($optText), strtolower($name)) !== false) { $title = $name . " Allotment Out"; $msg = "Allotment Live At Cameo India"; file_get_contents( "https://cipherteam.in/APPS/CronJobs/IPONEWSFINDERS/senNotification.php?key=PR@TIK@2552" . "&title=" . urlencode($title) . "&message=" . urlencode($msg) ); $foundCount++; break; // stop after first match } } } echo "Done. Checked CameoIndia IPOs: " . count($ipoNames) . " | Found: " . $foundCount . "\n"; exit(0); ?>
| ver. 1.4 |
Github
|
.
| PHP 8.2.9 | Generation time: 0.09 |
proxy
|
phpinfo
|
Settings