火车头小发猫AI伪原创[php源码]

对于大多数站长来说,有点困难,但是如果他们不知道如何原创,我们不知道如何伪原创吗?我把我常用的伪原创的方法列出来,希望对大家有所帮助。

使用教程:火车头采集器AI伪原创

$content));
    $new_content = get_gbk_data($new_content);
    $new_content = restore_shuminghao($new_content);
 
#var_dump($new_content);
 
    $new_content = content_format($new_content);
    $new_content = $new_content;
 
    #$new_title = get_ai_title($title);
	$title = get_utf8_data($title);
    $new_title = $title;
    //$new_title =curl_request(API_URL, array('wenzhang'=>$title));
	//$new_title = get_gbk_data($new_title);
    #echo $new_title;
 
    # 如果标题伪原创成功
    if ($new_title === 'xx'.$title) {
        $new_title = get_gbk_data($title);
        //save_new_file(DEST_FOLDER_FAIL.DIRECTORY_SEPARATOR.$new_title.'.txt', $new_content);
        save_new_file(DEST_FOLDER_FAIL.DIRECTORY_SEPARATOR.$title_src.'.txt', $new_content);
    }
    else {
        $new_title = strip_tags($new_title);
        $new_title = str_replace(':', ":", $new_title);
        $new_title = str_replace('?', "?", $new_title);
        $new_title = str_replace(array('*','"','<','>','|'),'_', $new_title);
        $new_title = get_gbk_data($new_title);
 
        #$title = get_gbk_data($title);
        #save_new_file(DEST_FOLDER.DIRECTORY_SEPARATOR.$new_title.'.txt', $new_content);
        save_new_file(DEST_FOLDER.DIRECTORY_SEPARATOR.$title_src.'.txt', $new_content);
        #save_new_file(DEST_FOLDER.DIRECTORY_SEPARATOR.$new_title.'.txt', $content);
    }
 
    //
    //
 
    #save_new_file(DEST_FOLDER.DIRECTORY_SEPARATOR.$title.'.txt', $new_content);
    file_ok($one_file);
 
    //show_info_gb2312('伪原创结果:'.PHP_EOL. $final_data);
    //save_new_file(DEST_FOLDER.DIRECTORY_SEPARATOR.$new_title, $new_content);
 
//var_dump($final_data);
 
//    sleep(3);
 
    $one_file = get_one_file();
//    show_reflesh();
}
 
show_info_gb2312(PHP_EOL.'任务完成'.PHP_EOL);
 
 
 
 
 
function replace_shuminghao($content) {
    $content = str_replace('![](', '<(', $content);
    $count = preg_match_all("/<\((.*?)\)/", $content, $matches);
    #var_dump($matches[0]);
    if (isset($matches[0][0]))
    {
        foreach ($matches[0] as $key => $value) {
	#echo $value;
            $new_val = '《'.$matches[1][$key].'》';
            $content = str_replace($value, $new_val, $content);
        }
    }
#echo $content;
    return $content;
}
 
 
function restore_shuminghao($content) {
    $count = preg_match_all("/《http(.*?)》/", $content, $matches);
    #var_dump($matches[0]);
    if (isset($matches[0][0]))
    {
        foreach ($matches[0] as $key => $value) {
            $new_val = '![](http'.$matches[1][$key].')';
            $content = str_replace($value, $new_val, $content);
        }
        #return $matches[0];
    }
    return $content;
}
 
 
 
function content_rewrite($content) {
    $data = curl_request(API_URL, array('wenzhang'=>$content));
    return $data;
}
 
function content_format($data) {
 
	$data = fix_newline($data);
	$data_arr = explode(PHP_EOL, $data);
	$ret_str = '';
	foreach($data_arr as $key => $value) {
#echo $value;
		$ret_str .= '  '.$value.PHP_EOL.PHP_EOL;
		#$ret_str .= 'bbbbbbbbbbbbbbbbbb';
	}
 
	return $ret_str;
}
 
function title_content_rewrite($title, $content) {
 
    $article_src = $title.TITLE_SEPAR.PHP_EOL.$content;
 
    $data = curl_request(API_URL, array('wenzhang'=>$article_src));
    $data = str_replace("Xx", "xx", $data);
    $data = str_replace("\n", "\r\n", $data);
    $data = str_replace("

\r\n", "

", $data); $data = ltrim($data); #var_dump($data); $temp = explode(TITLE_SEPAR, $data); #var_dump($temp); $temp[0] = trim($temp[0]); $temp[1] = ltrim($temp[1]); $temp[1] = ltrim($temp[1], '

'); $temp[1] = ltrim($temp[1]); $temp[1] = ltrim($temp[1]); return $temp; } function show_info($str) { echo '

' . $str . '

'; } function get_utf8_data($data) { $encode = mb_detect_encoding($data, array('ASCII', 'UTF-8', 'GB2312', 'GBK','BIG5')); if ($encode !== 'UTF-8') { //show_info_gb2312('文件非 UTF-8,正在转成UTF-8'); $utf8_data = iconv($encode, 'UTF-8//IGNORE', $data); return $utf8_data; } return $data; } function get_gbk_data($data) { $encode = mb_detect_encoding($data, array('ASCII', 'UTF-8', 'GB2312', 'GBK','BIG5')); if ($encode === 'UTF-8') { //show_info_gb2312('文件非 UTF-8,正在转成UTF-8'); $gbk_data = iconv('UTF-8//IGNORE', 'GBK//IGNORE', $data); return $gbk_data; } return $data; } function get_ai_title($title) { $title = urlencode($title); return curl_request($url); } function show_info_gb2312($string) { echo get_gbk_data($string); newline(); } function get_img_arr($array) { $ret_arr = array(); foreach ($array[1] as $key => $value) { if (stripos($value, 'C:\\') === 0) { $ret_arr[0][] = $value; } else { $ret_arr[1][] = $value; } } asort($ret_arr); return $ret_arr; } function str_replace_once($search, $replace, $subject) { $firstChar = strpos($subject, $search); if($firstChar !== false) { $beforeStr = substr($subject,0,$firstChar); $afterStr = substr($subject, $firstChar + strlen($search)); return $beforeStr.$replace.$afterStr; } else { return $subject; } } //var_dump(str_replace_once('**x**', 'xxxxxxxxxx', 'aaa**x**bbb')); //exit; function put_img_arr($array, $string) { $string = str_replace('**X**', '**x**', $string); foreach ($array as $key => $value) { $string = str_replace_once('**x**', $value, $string); } return $string; } function get_rewrite_title($data) { // var_dump($data); $data = reset_newline($data); $data_arr = explode(PHP_EOL, $data); $title = str_replace(array('

', '

'), array('',''), $data_arr[0]); array_shift($data_arr); $contents = '

'.implode(PHP_EOL, $data_arr); $new_arr = array($title, $contents); return $new_arr; } /* foreach ($news_list as $key => $value) { echo $value."
".PHP_EOL; $value = iconv("utf-8", "gb2312", $value); $data = file_get_contents($value); $data = iconv("GBK", "utf-8", $data); // echo $data; $data = rewrite($data); $data = str_replace("\r\n", "\n", $data); $data = str_replace("\r", "\n", $data); $data = str_replace("\n", "\r\n", $data); sleep(2); $data = auto_typeset($data); save_new_file('b'.$value, $data); } */ function auto_typeset($data) { $data = str_replace( array('

'."\r\n", '

', '

'), array('

', '

', '

  '), $data ); return $data; } function rewrite($article) { $url = API_URL; return curl_request($url, array('wenzhang'=>$article )); } function save_new_file($filename, $data) { if (! data_exists($filename)) { file_put_contents($filename, $data); } } // 缓存数据是否存在 function data_exists($filename) { $filename = str_replace('\\','/', $filename); // var_dump($filename); // var_dump(dirname($filename)); if (!is_dir(dirname($filename))) { // echo 'aaaaaaaaaaa'; mkdir(dirname($filename),0755,true); } // var_dump(dirname(dirname($filename))); if (!is_dir(dirname(dirname($filename)))) { // echo 'bbbbbbbbbb'; mkdir(dirname(dirname($filename)),0755,true); } if (file_exists($filename)) { return true; } return false; } function get_news_list($floder) { $news_list = array(); if($handle = opendir($floder)){ while (false !== ($file = readdir($handle))){ //$dir = iconv("utf-8", "gb2312", $file); $file = iconv("gb2312", "utf-8", $file); if ($file !== '..' && $file !== '.') { $news_list[] = $floder.DIRECTORY_SEPARATOR.$file; } // echo "$file\n"; } closedir($handle); } return $news_list; } //参数1:访问的URL,参数2:post数据(不填则为GET),参数3:提交的$cookies,参数4:是否返回$cookies function curl_request($url,$post='',$cookie='', $returnCookie=0){ $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)'); if (ini_get('open_basedir') == '' && strtolower(ini_get('safe_mode')) != 'on'){ curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); } curl_setopt($curl, CURLOPT_AUTOREFERER, 1); curl_setopt($curl, CURLOPT_REFERER, "http://XXX"); if($post) { curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post)); } if($cookie) { curl_setopt($curl, CURLOPT_COOKIE, $cookie); } curl_setopt($curl, CURLOPT_HEADER, $returnCookie); curl_setopt($curl, CURLOPT_TIMEOUT, 150); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec($curl); if (curl_errno($curl)) { return curl_error($curl); } curl_close($curl); if($returnCookie){ list($header, $body) = explode("\r\n\r\n", $data, 2); preg_match_all("/Set\-Cookie:([^;]*);/", $header, $matches); $info['cookie'] = substr($matches[1][0], 1); $info['content'] = $body; return $info; }else{ return $data; } } // 计算中文字符串长度 function utf8_strlen($string = null) { // 将字符串分解为单元 preg_match_all("/./us", $string, $match); // 返回单元个数 return count($match[0]); } function get_one_file() { $arr_all = get_all_files(); #var_dump( $arr_all ); $arr_ok = get_ok_files(); //var_dump($arr_ok); foreach($arr_all as $v) { if (array_search($v, $arr_ok)===false) { return $v; } } return false; } function get_all_files() { return listDir(CUR_FOLDER); } function get_ok_files() { //var_dump(CUR_DIR.'ok.txt'); $data = file_get_contents(CUR_DIR.'ok.txt'); $data = str_replace("\xef\xbb\xbf", '', $data); $data_arr = explode(PHP_EOL, $data); return $data_arr; } function file_ok($file_name) { file_put_contents(CUR_DIR.'ok.txt', $file_name.PHP_EOL, FILE_APPEND); } function listDir($dir) { // echo $dir; $reta = array(); if(is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { if((is_dir($dir."/".$file)) && $file!="." && $file!="..") { //echo 'aa'; //$file = iconv("gb2312", "utf-8//IGNORE", $file); // $file = ConvertToUTF8($file); #$file = mb_convert_encoding($file, 'UTF-8', 'GBK'); $reta[] = $file; // echo "文件名:",$file,"


"; listDir($dir."/".$file."/"); } else { if($file!="." && $file!="..") { // echo $file."
"; if (stripos($file, '.txt')!==false) { #$file = iconv("GBK", "utf-8//IGNORE", $file); // echo $file.'
'; $reta[] = $file; } } } } closedir($dh); } } //var_dump($reta); return $reta; } function file_path($filename) { return CUR_FOLDER.DIRECTORY_SEPARATOR.$filename; } function short_filename($filename) { $filename = str_replace(CUR_FOLDER.DIRECTORY_SEPARATOR, '', $filename); $filename = str_replace('.txt', '', $filename); return $filename; } function get_contents_filter($file_name) { $file_name = get_gbk_data($file_name); // $file_name = mb_convert_encoding($file_name, 'UTF-8', 'ISO-8859-15'); /// $file_name = iconv("utf-8", "GBK//IGNORE", $file_name); // echo $file_name.'
'; $data = file_get_contents($file_name); $data = get_gbk_data($data); $data = str_replace("\t", '', $data); // 优化换行符 $data = fix_newline($data); $data_title = short_filename($file_name); //var_dump(get_utf8_data($data)); return array('title'=>$data_title, 'content'=>$data); } function fix_newline($data) { $data = str_replace("\r", "\n", $data); while(strpos($data, "\n\n") !== false) { $data = str_replace("\n\n", "\n", $data); } $data = str_replace("\n", PHP_EOL, $data); return $data; } function show_reflesh() { $str = ''; echo $str; } function after ($this, $inthat) { if (!is_bool(strpos($inthat, $this))) return substr($inthat, strpos($inthat,$this)+strlen($this)); }; function after_last ($this, $inthat) { if (!is_bool(strrevpos($inthat, $this))) return substr($inthat, strrevpos($inthat, $this)+strlen($this)); }; function before ($this, $inthat) { return substr($inthat, 0, strpos($inthat, $this)); }; function before_last ($this, $inthat) { return substr($inthat, 0, strrevpos($inthat, $this)); }; function between ($this, $that, $inthat) { return before ($that, after($this, $inthat)); }; function between_last ($this, $that, $inthat) { return after_last($this, before_last($that, $inthat)); }; // use strrevpos function in case your php version does not include it function strrevpos($instr, $needle) { $rev_pos = strpos (strrev($instr), strrev($needle)); if ($rev_pos===false) return false; else return strlen($instr) - $rev_pos - strlen($needle); }; function recurse_copy($src,$dst) { $dir = opendir($src); @mkdir($dst); while(false !== ( $file = readdir($dir)) ) { if (( $file != '.' ) && ( $file != '..' )) { if ( is_dir($src . '/' . $file) ) { recurse_copy($src . '/' . $file,$dst . '/' . $file); } else { if (strpos($file, '.txt') === false) { copy($src . '/' . $file,$dst . '/' . $file); } } } } closedir($dir); } function ConvertToUTF8($text){ $encoding = mb_detect_encoding($text, mb_detect_order(), false); if($encoding == "UTF-8") { $text = mb_convert_encoding($text, 'UTF-8', 'UTF-8'); } $out = iconv(mb_detect_encoding($text, mb_detect_order(), false), "UTF-8//IGNORE", $text); return $out; } function newline() { echo PHP_EOL; } function sanitizeUTF8($value) { if (self::getIsIconvEnabled()) { // NEW ---------------------------------------------------------------- $encoding = mb_detect_encoding($value, mb_detect_order(), false); if($encoding == "UTF-8") { $value = mb_convert_encoding($value, 'UTF-8', 'UTF-8'); } $value = iconv(mb_detect_encoding($value, mb_detect_order(), false), "UTF-8//IGNORE", $value); // -------------------------------------------------------------------- // OLD -------------------------------------- // $value = @iconv('UTF-8', 'UTF-8', $value); // ------------------------------------------- return $value; } $value = mb_convert_encoding($value, 'UTF-8', 'UTF-8'); return $value; } ?>

火车头小发猫AI伪原创[php源码]_第1张图片

 

1、更改文章标题这是最基本的操作方法,也是我们最常用的方法。如果有时候,你实在没有时间,你可以直接模仿一篇文章,但是你的标题必须改一下,如果你改了标题,可能会被收录。如果连标题都不改的话,基本上是很难进入的,尤其是权重比较低的网站。对于一些高权重的网站来说,如果你从其他地方复制一篇文章,它可以立即被收录,但对于我们的低权重网站来说则不然。所以标题一定要改,这是最有启发的。例如,原文章标题为《啥是锚文本》,您可以将标题更改为《咱们应当怎样了解锚文本》。当然,标题要贴近本文的主题,只要不是无关的也行。

2、在原创内容中植入自己的原创内容。今年春晚嵌入广告的概念我们都知道。也就是说,在原创文章的每个合适的地方,特别是头部和尾部,尽可能多地添加自己的原创内容。本文的头部和尾部是相同的,并且头部和尾部的权重相对较高。当然,你也可以在中间添加自己的原创内容。事实上,一篇文章只需与原文有30%的差异即可。

3、打乱原创文章的内容顺序也是一件很容易做到的事情。调整阶段非常简单。现在大多数人都会使用一些伪原创的工具。如果有工具的话,就会有调整阶段和无序文章内容顺序的功能,只要我们把文章复制进去,然后点击就可以了,很方便,但是通过发布的文章伪原创这种方法往往可读性和逻辑性都不是很好,而且很乱,让读者对你所表达的内容感到困惑,所以我们最好手动调整文章内容的阶段,例如调整第一项到第十项,在讨论一个问题的时候,如果有5点,那么我们可以把这5点的呈现顺序调整一下,这是一个非常好的操作。

4、替换文章中的一些单词或短语。现在伪原创的工具大部分都有这个功能,不过还是手动替换比较好。注意不要堆砌关键词,尤其是有些东西有时甚至会被单词的反义词代替。经过这样的替换,意义几乎完全不同了。

6、扫描文档为了创作原创文章,也就是网上找不到的文章内容,有的兄弟专门买了一台扫描仪,扫描一些书籍的内容,然后将扫描的内容转换成文本形式内容,然后通过最好修改整理,写一篇网上没有内容的文章。本来我们可以去图书馆借书,然后用扫描仪在网上扫描。尤其是一些旧书,可能其内容还没有在网络上流传。这时候我们就可以用它来做文章,当然也可以打字。只是需要时间,没有扫描仪的话速度更快。

以原文为结构,用自己的话重新写这篇文章,注意使用自己的语言。这样,通过改写文章标题、颠倒文章阶段、换词、互相翻译等方式,就可以创作出一篇基本原创的文章。

你可能感兴趣的:(php,android,开发语言)