File manager - Edit - /home/cipherteam/htdocs/cipherteam.in/APPS/CronJobs/GetGMPLatest.php
Back
<?php $con=mysqli_connect("localhost:3306", "marketdatauser_ci", "d7o7A8%s2d7", "market_data_ci"); $sql = "SELECT `value` AS 'VAL' FROM `CronJobData` WHERE `datakey` = 'IWGMP';"; $rows = $con->query($sql); $data = $rows->fetch_assoc(); include_once("simple_html_dom.php"); $html = file_get_html("https://www.ipowatch.in/p/ipo-grey-market-premium-latest-ipo-grey.html"); $tbody = $html->find('tbody',0); $st = ""; foreach($tbody->find('tr') as $tr) { $td0 = $tr->find('td',0)->plaintext; $td1 = $tr->find('td',1)->plaintext; $td2 = $tr->find('td',2)->plaintext; $td3 = $tr->find('td',3)->plaintext; $st = $st.$td0.$td1.$td2.$td3; } if($data['VAL'] != $st) { $path_to_fcm = "https://fcm.googleapis.com/fcm/send"; $server_key = "AAAAzvFKC6k:APA91bGwplf3DZMMEsvtWCoeCXnBttNVgS2h3s5GuPDA6RkYvnFZuYNLy-zYt5TlVAm2fusnmh3ZFZbTxpLs1xMVIRfXmYd-yQe-CpjItU0Im6zUcjbq9bLFuj9-2y7LSkBfp2eS2Qoo"; $curl_session = curl_init(); $sql = "SELECT `fcmid` as 'FCM' FROM `admin_fcm`"; $result = $con->query($sql); while($row = $result -> fetch_assoc()) { $title = "GMP Updated"; $msg = "ipowatch Updated check out at ipowatch.in"; $headers = array( 'Authorization: key=' . $server_key, 'Content-Type: application/json' ); $fields = array( 'to' => $row['FCM'], 'notification'=> array( 'title'=> $title, 'body'=> $msg, 'click_action' => 'MAIN' )); $payload = json_encode($fields); curl_setopt($curl_session, CURLOPT_URL,$path_to_fcm); curl_setopt($curl_session, CURLOPT_POST, true); curl_setopt($curl_session, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl_session, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl_session, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl_session, CURLOPT_POSTFIELDS, $payload); $res = curl_exec($curl_session); $res = curl_exec($curl_session); $res = curl_exec($curl_session); } curl_close($curl_session); $sql = "UPDATE `CronJobData` SET `value` = '$st' WHERE `datakey` = 'IWGMP'"; $con->query($sql); } ?>
| ver. 1.4 |
Github
|
.
| PHP 8.2.9 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings