File manager - Edit - /home/cipherteam/htdocs/cipherteam.in/APPS/CronJobs/bigshare/bigshareAllotment.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"); function splitIpoNames($raw) { // supports: "Corona, Meesho ,Kahan" $parts = preg_split('/\s*,\s*/', trim((string)$raw)); $out = []; foreach ($parts as $p) { $p = trim($p); if ($p !== '') $out[] = $p; } // unique, keep order return array_values(array_unique($out)); } /* ---------------- Get IPO Names ONLY for Bigshare ---------------- */ $ipoNames = []; $res = mysqli_query($con, " SELECT ipo_name FROM scraper_servers WHERE is_enabled = 1 AND server_name = 'Bigshare' 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)); while ($row = mysqli_fetch_assoc($res)) { $ipoNames[] = trim($row['ipo_name']); } if (empty($ipoNames)) { echo "No Bigshare IPO names found.\n"; exit; } /* ---------------- Fetch Bigshare page once ---------------- */ $html = file_get_html("https://ipo.bigshareonline.com/IPO_Status.html"); $list = $html ? $html->find('select[id=ddlCompany]', 0) : null; if (!$list) { echo "Company dropdown not found on Bigshare page.\n"; exit; } /* ---------------- Extract dropdown options ---------------- */ $options = []; foreach ($list->find('option') as $opt) { $txt = trim($opt->plaintext); if ($txt !== '') $options[] = $txt; } /* ---------------- CLI-safe URL logic (no warnings) ---------------- */ $domain = $_SERVER['SERVER_NAME'] ?? 'cipherteam.in'; $docRoot = $_SERVER['DOCUMENT_ROOT'] ?? ''; $path = $docRoot ? substr(__FILE__, strlen($docRoot)) : basename(__FILE__); $url = "https://" . $domain . "/" . ltrim($path, "/"); $opt = $url; // kept as you had /* ---------------- Check IPO names ---------------- */ foreach ($ipoNames as $name) { foreach ($options as $optText) { if (strpos(strtolower($optText), strtolower($name)) !== false) { $title = $optText . " Allotment Out"; $msg = "Allotment Live At Bigshare S1"; file_get_contents( "https://cipherteam.in/APPS/CronJobs/IPONEWSFINDERS/senNotification.php?key=PR@TIK@2552" . "&title=" . urlencode($title) . "&message=" . urlencode($msg) ); break; } } } echo "Done. Checked Bigshare IPOs: " . count($ipoNames) . "\n"; ?>
| ver. 1.4 |
Github
|
.
| PHP 8.2.9 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings