$lang = filter_var($_GET['lang'], FILTER_SANITIZE_SPECIAL_CHARS); if((strpos(trim($_GET['keyword']), ' ') == false) and $lang == 'us'){ $keyword = '%22' .$_GET['keyword'] .'%22'; $keyword= filter_var($keyword, FILTER_SANITIZE_SPECIAL_CHARS); } else { $keyword= filter_var($_GET['keyword'], FILTER_SANITIZE_SPECIAL_CHARS); } $urlsource = $baseurl ."read.php?keyword=" .urlencode($keyword) ."&lang=" .$lang ."&links=remove"; include ('accesskey.php'); $getkey= filter_var($_GET['accesskey'], FILTER_SANITIZE_SPECIAL_CHARS); $numbers = filter_var($_GET['numbers'], FILTER_SANITIZE_SPECIAL_CHARS); if (in_array($getkey, $accesskey) or (($_GET['rewrite'] == 'original') and ($numbers == 3) and ($lang == 'us'))) { $gettitle = filter_var($_GET['keyword'], FILTER_SANITIZE_SPECIAL_CHARS) ." :: Article Creator"; echo("$gettitle"); $prefix = mt_rand(100,1000); $myFile = 'foldertemp/' .$prefix ."_generatedfile.txt"; $spintaxtfile = 'foldertemp/' .$prefix ."_generatedfile_SPINTAXT.txt"; if(file_exists("$myFile")) unlink("$myFile"); if(file_exists("$spintaxtfile")) unlink("$spintaxtfile"); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $urlsource); curl_setopt($ch, CURLOPT_FAILONERROR, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 300); $returned = curl_exec($ch); curl_close($ch); $feed = simplexml_load_string($returned); $count = 0; $maxitems = $numbers; foreach ($feed->channel->item as $item) { if ($count < $maxitems){ $title = $item->title; $title = str_replace("", "", $title); $subject = str_replace("", "", $title); $link = $item->link; $body= $item->description; //$body = preg_replace('/]*>(.*?)<\/script>/is', "", $body); $body = strip_tags($body, '

  • '); $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=utf-8" . "\r\n"; if (($_GET['rewrite'] == 'unique') and ($lang == 'us')) { require_once('unik.class.php'); require_once ('spinter.php'); $data = $body; $unik=new unik; $spintaxbody=$unik->spin($data); $spinter = new Spinter(); $newbody=$spinter->process($spintaxbody); $data = $subject; $unik=new unik; $spintaxsubject=$unik->spin($data); $spinter = new Spinter(); $newsubject=$spinter->process($spintaxsubject); } else { $newbody = $body; $newsubject = $subject; } echo "

    " .$newsubject ."

    "; echo $newbody; echo "
    "; $newbody = preg_replace ('/<[^>]*>/', ' ', $newbody); // ----- remove control characters ----- $newbody = str_replace("\r", '', $newbody); // --- replace with empty space $newbody = str_replace("\n", ' ', $newbody); // --- replace with space $newbody = str_replace("\t", ' ', $newbody); // --- replace with space // ----- remove multiple spaces ----- $newbody = trim(preg_replace('/ {2,}/', ' ', $newbody)); $filecontent = $newsubject ." " ."\n" ."\n" .$newbody ."\n" ."\n" ."\n"; $fh = fopen($myFile, 'a'); fwrite($fh, "\xEF\xBB\xBF".$filecontent); if (($_GET['rewrite'] == 'unique') and ($lang == 'us')) { $spintaxbody = preg_replace ('/<[^>]*>/', ' ', $spintaxbody); // ----- remove control characters ----- $spintaxbody = str_replace("\r", '', $spintaxbody); // --- replace with empty space $spintaxbody = str_replace("\n", ' ', $spintaxbody); // --- replace with space $spintaxbody = str_replace("\t", ' ', $spintaxbody); // --- replace with space // ----- remove multiple spaces ----- $spintaxbody = trim(preg_replace('/ {2,}/', ' ', $spintaxbody)); $filecontentspintax = $spintaxsubject ." " ."\n" ."\n" .$spintaxbody ."\n" ."\n" ."\n"; $fsx = fopen($spintaxtfile, 'a'); fwrite($fsx, "\xEF\xBB\xBF".$filecontentspintax); } } $count++; if(is_resource($fh)) { fclose($fh); } } echo "
    Download TXT file
    "; if (($_GET['rewrite'] == 'unique') and ($lang == 'us')) { echo "
    SPINTAX format
    ";} echo "
    Generate new articles

    "; } else { $page_title = "Invalid Access Key!"; echo("$page_title"); echo "

    Invalid Access Key!

    "; } ?>