bot

mail@pastecode.io avatar
unknown
php
2 years ago
3.7 kB
2
Indexable
Never
<?php
require __DIR__ . '/config/config.php';
require __DIR__ . '/config/database.php';
require __DIR__ . '/config/functions.php';

error_reporting();
$sitesor=$db->prepare("SELECT * from siteler");
$sitesor->execute(array());
$sitecek=$sitesor->fetch(PDO::FETCH_ASSOC);
$dosya=dosyaoku('proxies.txt');
$proxyler=explode(' ',$dosya);
$eleman=count($proxyler);
$a=2;
$eleman2= $eleman - $a;
$r=random_int(0,$eleman2);
$proxyler=explode(':',$proxyler[$r]);
$proxy=$proxyler[0];
$port=$proxyler[1];
$curl_defaults = array(
    CURLOPT_HEADER => 0,
    CURLOPT_FOLLOWLOCATION => 1,
    CURLOPT_AUTOREFERER => 1,
    CURLOPT_RETURNTRANSFER => 1,
    CURLOPT_CONNECTTIMEOUT => 15,
    CURLOPT_TIMEOUT => 15,
    CURLOPT_VERBOSE => 0,
    CURLOPT_SSL_VERIFYHOST => 0,
    CURLOPT_SSL_VERIFYPEER => 0
    );
$ch=curl_init();
curl_setopt_array($ch,$curl_defaults);
curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36');
curl_setopt($ch,CURLOPT_URL,$sitecek['site_url']);
curl_setopt($ch, CURLOPT_PROXYPORT, $port);
curl_setopt($ch, CURLOPT_PROXYTYPE, "HTTP"); // HTTP/HTTPS türü proxy kullanacağız.
curl_setopt($ch, CURLOPT_PROXY, $proxy);
$html=curl_exec($ch);
curl_close($ch);




$postlinkal=explode('<h4><a href="',$html);
$postlinkal=explode('"',$postlinkal[1]);
$post_url=$postlinkal[0];

$curl_defaults = array(
    CURLOPT_HEADER => 0,
    CURLOPT_FOLLOWLOCATION => 1,
    CURLOPT_AUTOREFERER => 1,
    CURLOPT_RETURNTRANSFER => 1,
    CURLOPT_CONNECTTIMEOUT => 15,
    CURLOPT_TIMEOUT => 15,
    CURLOPT_VERBOSE => 0,
    CURLOPT_SSL_VERIFYHOST => 0,
    CURLOPT_SSL_VERIFYPEER => 0
    );
$ch=curl_init();
curl_setopt_array($ch,$curl_defaults);
curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36');
curl_setopt($ch,CURLOPT_URL,$post_url);
curl_setopt($ch, CURLOPT_PROXYPORT, $port);
curl_setopt($ch, CURLOPT_PROXYTYPE, "HTTP"); 
curl_setopt($ch, CURLOPT_PROXY, $proxy);
$posticerik=curl_exec($ch);
curl_close($ch);

$icerik=explode('<div class="post-content entry-content">',$posticerik);
$icerik=explode("<script>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1612022265060-0'); });</script>", $icerik[1]);
$icerik=explode('<div class="thb-article-bottom-ad"><div class="thb-ad-title"><span>REKLAM</span></div><div class="thb-ad thb-desktop thb-responsive">', $icerik[1]);
$metin=$icerik[0];
$sonyazisor=$db->prepare("SELECT * from yazi where yazi_id=:yazi_id");
$sonyazisor->execute(array('yazi_id' => 1));
$sonyazicek=$sonyazisor->fetch(PDO::FETCH_ASSOC);
$yazikaydet=$db->prepare("UPDATE yazi SET
    yazi_metin=:yazi_metin
    WHERE yazi_id=1");
  $update3=$yazikaydet->execute(array(
    'yazi_metin' => $metin
    ));
for ($i=0; $i < $eleman; $i++) { 
$metinveri=$sonyazicek['yazi_metin'];
$kelimeler=explode(' ', $metinveri);
$kelimesor=$db->prepare("SELECT * from kelimeler where kelime_aranan=:kelime_aranan");
$kelimesor->execute(array(
	'kelime_aranan'=> $kelimeler[$i]
));
$kelimecek=$kelimesor->fetch(PDO::FETCH_ASSOC);
$degistir=$kelimecek['kelime_degistirilecek'];
$say=$kelimesor->rowCount();
echo $say['kelime_aranan'];

/*if ($say['kelime_aranan']=='1') {
$yazininsonhali=str_replace($kelimeler[$i],"AAAAAAAAAdanaaaaaaaaaaaaaaaaa",$metinveri);
$yazikaydet=$db->prepare("UPDATE yazi SET
    yazi_metin=:yazi_metin
    WHERE yazi_id=1");
  $update3=$yazikaydet->execute(array(
    'yazi_metin' => $yazininsonhali
    ));
}
*/
}









?>