File manager - Edit - /home/cipherteam/htdocs/cipherteam.in/APPS/CronJobs/chittorgarh/SMEIPO.php
Back
<?php include_once("simple_html_dom.php"); $html = file_get_html("https://www.chittorgarh.com/report/sme-ipo-list-in-india-bse-sme-nse-emerge/84/"); $tbody = $html->find('tbody',0); $myfile = fopen("/var/www/vhosts/cipherteam.in/httpdocs/APPS/CronJobs/chittorgarh/sme.txt", "r") or die("Unable to open file!"); $data = fread($myfile,filesize("/var/www/vhosts/cipherteam.in/httpdocs/APPS/CronJobs/chittorgarh/sme.txt")); fclose($myfile); $data = explode(',',$data); $ipo = ""; foreach($tbody->find('tr') as $tr) { $name = trim($tr->find('td',0)->plaintext); $from = trim($tr->find('td',2)->plaintext); $to = trim($tr->find('td',3)->plaintext); if(!in_array($name,$data)) { $ipo = $ipo . ',' . $name; alertIPO($name,$from,$to); } } if($ipo != "") { $fp = fopen('/var/www/vhosts/cipherteam.in/httpdocs/APPS/CronJobs/chittorgarh/sme.txt', 'a'); fwrite($fp, $ipo); fclose($fp); echo $ipo; } function alertIPO($name,$from,$to) { $con=mysqli_connect("localhost:3306", "marketdatauser", "d7o7A8%s2d7", "marketdataci"); $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 = "New SME IPO ".$name; $msg = "Chittorgarh.com From " . $from . ' To ' . $to; $headers = array( 'Authorization: key=' . $server_key, 'Content-Type: application/json' ); $fields = array( 'to' => $row['FCM'], 'notification'=> array( 'title'=> $title, 'body'=> $msg, 'click_action' => 'CMAINLINEIPO' )); $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); sleep(5); $res = curl_exec($curl_session); sleep(5); $res = curl_exec($curl_session);*/ } curl_close($curl_session); } ?>
| ver. 1.4 |
Github
|
.
| PHP 8.2.9 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings