<?php 

// Generated by curl-to-PHP: http://incarnate.github.io/curl-to-php/
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://play.google.com/store/apps/details?id=com.hupto.sevgilibul');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');

curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Authority: play.google.com';
$headers[] = 'Pragma: no-cache';
$headers[] = 'Cache-Control: no-cache';
$headers[] = 'Upgrade-Insecure-Requests: 1';
$headers[] = 'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1';
$headers[] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9';
$headers[] = 'Sec-Fetch-Site: none';
$headers[] = 'Sec-Fetch-Mode: navigate';
$headers[] = 'Sec-Fetch-User: ?1';
$headers[] = 'Sec-Fetch-Dest: document';
$headers[] = 'Accept-Language: tr-TR,tr;q=0.9';
$headers[] = 'Cookie: NID=511=UPOfdMOF0tsiBKbBW8-uej_fZJnJQ9kXFUU_XcOvZHnnBuKTdl6Uwltsgb0QEwj8ze-ijf7QkFxh1Q6kJiA7VaZ24_ah1taWzLLb_p74hrc-HJK94eqVqfA9KbpztALzwXGEU-3bfhOUf66NKnWcMfoSXDjmU87I_JUy3VZlBOE; _ga=GA1.3.1154645389.1635947697; _gid=GA1.3.183468225.1635947697; _gat_UA199959031=1; OTZ=6227395_44_48_123900_44_436380';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
curl_close($ch);

//$myfile = fopen("result.txt", "w") or die("Unable to open file!");
//$txt = $result;
//fwrite($myfile, $txt);
//fclose($myfile);

$konum = strpos($result, 'Maalesef');
if ($konum !== false) {
echo "MALESEF YAYINDA DEĞİL";

}else{
echo "YAYINDA UYGULAMA";

$token = "2039215678:AAHz7uXdojLiXTkSme_UHy6TuJHsiIyr9Tc";
 
$parametre= array(
'chat_id' => "713052668",
'text' => "Uygulama yayında lan koş! ".rand(100,999),
);
$ch = curl_init();
$url = "https://api.telegram.org/bot".$token."/sendmessage";
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $parametre);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$result = curl_exec($ch);

}



//echo "<textarea>".$result."</textarea>";

?>