伪原创智能改写api百度【php源码】

用百度自家的产品来生成的文章,原创度和收录相当理想,伪原创智能改写api百度,以毒攻毒。

 从全球趋势来看,信息化、智能化、智能化是建设智慧城市的必由之路。2022年,德勤发布《超级智慧城市报告》。

伪原创智能改写api百度【php源码】暂时只有php,其他语言欢迎补充

<?php


set_time_limit(270);
error_reporting(E_ERROR | E_WARNING | E_PARSE);

define('TITLE_SEPAR', 'xxx**xxx');
define('TITLE_SEPAR2', '262661');


$url = 'http://www.xiaofamao.com/api.php?json=0&v=1&key=abcccc';

$content_tag_name = '内容';


$headdd = '';
$taill = '';



switch($LabelArray['PageType'])
{
    case 'List'://处理列表页,只能处理html
        break;
    case 'Pages'://处理多页,只能处理html
        break;
    case 'Content'://处理默认页,只能处理html
        break;
    case 'Save'://只有保存时是可以处理标签值的
        // 保存原文

    try {
    /**********************************************************************/
    // 这一步用来获取伪原创文章
    /**********************************************************************/
    $title = $LabelArray['标题'];
    $title = '标题:'.$title;

    $content = $LabelArray[$content_tag_name];
    #$content = str_replace('2020/', '2020_', $content);

    $article_src = compose_article($title, $content);
    $article_src_b = $article_src;

    $article_new = get_wyc_article($article_src);


    $title_wyc = trim($article_new[0]);
    $content_wyc = trim($article_new[1]);

    $content_wyc = fix_newline($content_wyc);
    $content_wyc = str_replace('标签:', '标签:', $content_wyc);
    $LabelArray[$content_tag_name] = $headdd. $content_wyc. $taill;

    $title_wyc = str_replace(array('。',',','%'), array(' ',' ',' '), $title_wyc);
    $LabelArray['标题'] = $title_wyc;
    }
    catch (Exception $e) {
        $LabelArray['标题'] .= $e->getMessage();
        $LabelArray[$content_tag_name] .= $e->getMessage();
    }
        break;
    default:
        //$LabelArray[$content_tag_name]=curl_request($url, array('wenzhang'=>$LabelArray[$content_tag_name] ));
}

echo serialize($LabelArray);



function compose_article($title, $content) {
    $separator = compose_separator();
    return $title.$separator.$content;
}

function compose_separator() {
    return PHP_EOL.'('.TITLE_SEPAR2.')'.PHP_EOL;
}


function fix_separator($article) {
    return $article;
}


function get_wyc_article($str) {
    global $url;
    $separator = compose_separator();
    $separator = str_replace(PHP_EOL, '', $separator);
    $wyc = curl_request($url, array('wenzhang'=>$str));

    $wyc_f = $wyc;
    $wyc = fix_separator($wyc);
    $wyc = explode($separator, $wyc);

    if (isset($wyc[0])){
        $wyc[0] = str_replace('标题:', '', $wyc[0]);
        $wyc[0] = str_replace('标题:', '', $wyc[0]);
        $wyc[0] = str_replace('目:', '', $wyc[0]);
        $wyc[0] = str_replace('目:', '', $wyc[0]);
        $wyc[0] = 'xx`xx'.$wyc[0];
        $wyc[0] = str_replace('xx`xx题', '', $wyc[0]);
        $wyc[0] = str_replace('xx`xx', '', $wyc[0]);
    }

    //if (isse
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值