释放双眼,带上耳机,听听看~!
伪原创处理内容
<?php
error_reporting(E_ERROR | E_WARNING | E_PARSE);
//echo LabelArray;
$new_LabelArray = array();
$api_list = array(
'https://www.luryl.com',//伪原创API服务器1
);
$random_keys=array_rand($api_list,1);
$url = $api_list[$random_keys].'/api.php?type=post';
//随机调用 api1 和 api2服务器
/**
* /api/creation 为AI智能版伪原创处理标题接口
* /api/creation /api/creation_v2 为AI智能版伪原创处理标题描述内容接口
*/
$data['token'] = 'shaoyu521'; //路人伪原创 默认 shaoyu521
if(isset($LabelArray['标题'])){
$data['title'] = $LabelArray['标题'];
}
if(isset($LabelArray['描述'])){
$data['description'] = $LabelArray['描述'];
}
if(isset($LabelArray['内容'])){
$data['content'] = $LabelArray['内容'];
}
//var_dump($data);exit;
$postUrl = $url;
$curlPost = $data;
$curl = curl_init();//初始化curl
curl_setopt($curl, CURLOPT_URL,$postUrl);//抓取指定网页
curl_setopt($curl, CURLOPT_HEADER, 0);//设置header
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);//要求结果为字符串且输出到屏幕上
curl_setopt($curl, CURLOPT_POST, 1);//post提交方式
curl_setopt($curl, CURLOPT_POSTFIELDS, $curlPost);
$response = curl_exec($curl);//运行curl
//var_dump($response);exit;
if (curl_errno($curl)) {
$new_LabelArray['状态'] = curl_error($curl);
if(isset($LabelArray['标题'])){
$new_LabelArray['标题'] = $LabelArray['标题'];
}
if(isset($LabelArray['描述'])){
$new_LabelArray['描述'] = $LabelArray['描述'];
}
if(isset($LabelArray['内容'])){
$new_LabelArray['内容'] = $LabelArray['内容'];
}
}
curl_close($curl); // 关闭CURL会话
$result = json_decode($response,true);
if($result['status']==1){
$new_LabelArray['状态'] = 'OK';
if(strlen($result['new_title'])>0){
$new_LabelArray['标题'] = $result['new_title'];
}
if(strlen($result['new_description'])>0){
$new_LabelArray['描述'] = $result['new_description'];
}
if(strlen($result['new_content'])>0){
$new_LabelArray['内容'] = $result['new_content'];
}
}else{
$new_LabelArray['状态'] = $result['error_msg'];
if(isset($LabelArray['标题'])){
$new_LabelArray['标题'] = $LabelArray['标题'];
}
if(isset($LabelArray['描述'])){
$new_LabelArray['描述'] = $LabelArray['描述'];
}
if(isset($LabelArray['内容'])){
$new_LabelArray['内容'] = $LabelArray['内容'];
}
}
//var_dump($new_LabelArray);exit;
//#############以下语句必须保留,建议不更改###################################################################################################################
ob_clean();
echo serialize($new_LabelArray);
?>