File manager - Edit - /home/cipherteam/htdocs/cipherteam.in/APPS/CronJobs/MUFG/MUFGAllotment.php
Back
<?php ini_set('display_errors', 0); error_reporting(E_ALL & ~E_WARNING & ~E_NOTICE); /* ---------------- 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 MUFG ---------------- If your DB uses different text like "MUFGLINK", change it below. */ $res = mysqli_query($con, " SELECT ipo_name FROM scraper_servers WHERE is_enabled = 1 AND server_name = 'MUFG' 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 MUFG IPO names found.\n"; exit(0); } /* ---------------- Call MUFG API (once) ---------------- */ $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://in.mpms.mufg.com/Initial_Offer/IPO.aspx/GetDetails', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_HTTPHEADER => array( 'accept: application/json, text/javascript, */*; q=0.01', 'accept-language: en-US,en;q=0.9,gu;q=0.8', 'content-length: 0', 'content-type: application/json;charset:utf-8', 'origin: https://in.mpms.mufg.com', 'referer: https://in.mpms.mufg.com/Initial_Offer/public-issues.html', 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome Safari/537.36', 'x-requested-with: XMLHttpRequest' ), )); $response = curl_exec($curl); $curlErr = curl_error($curl); curl_close($curl); if ($response === false || $response === "" ) { echo "MUFG API failed: " . $curlErr . "\n"; exit(0); } /* ---------------- Check each IPO name in response ---------------- */ $respLower = strtolower($response); $foundCount = 0; foreach ($ipoNames as $name) { if ($name === '') continue; if (strpos($respLower, strtolower($name)) !== false) { $title = $name . " Allotment Out"; $msg = "Allotment Live @ MUFG"; file_get_contents( "https://cipherteam.in/APPS/CronJobs/IPONEWSFINDERS/senNotification.php?key=PR@TIK@2552" . "&title=" . urlencode($title) . "&message=" . urlencode($msg) ); $foundCount++; } } echo "Done. Checked MUFG IPOs: " . count($ipoNames) . " | Found: " . $foundCount . "\n"; exit(0); ?>
| ver. 1.4 |
Github
|
.
| PHP 8.2.9 | Generation time: 0.09 |
proxy
|
phpinfo
|
Settings