文章原创PHP检测源码分享
<?php
function curl($url,$post=0){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$httpheader[] = "Accept:*/*";
$httpheader[] = "Accept-Encoding:gzip,deflate,sdch";
$httpheader[] = "Accept-Language:zh-CN,zh;q=0.8";
$httpheader[] = "Connection:close";
$httpheader[] = "Host:check1.myleguan.com";
$httpheader[] = "Origin: http://www.myleguan.com";
curl_setopt($ch, CURLOPT_HTTPHEADER, $httpheader);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_REFERER, 'http://www.myleguan.com/lgEditor/lgEditor.html');
curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3314.0 Safari/537.36 SE 2.X MetaSr 1.0');
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, '60');
$ret = curl_exec($ch);
curl_close($ch);
return $ret;
}
$content=$_POST['content'];
$title=mb_strimwidth($content, 0, 10, '', 'utf8');
$content_mediaobj=curl('http://check1.myleguan.com/Keyword/checkoriginal','content='.$content.'&title='.$title);
$json=json_decode($content_mediaobj,1);
$ycd=$json['ycpercent'];//原创度数字
$xsd=$json['mediaobj']['0']['score'];
if($ycd <=40){
$str = "您的相似度($xsd)很低,属于原创文章,可以发布";
}else if($ycd <=55 && $ycd > 40){
$str = "您的相似度($xsd)较低,基本属于原创文章,可以发布";
}else if($ycd <=70 && $ycd > 55){
$str = "您的相似度($xsd)比较高,建议修改后再发布";
}else if($ycd > 70){
$str = "您的相似度($xsd)非常高,不建议发布";
}
echo $str;
以上就是速优网络和大家分享的"文章原创PHP检测源码分享",非常感谢您有耐心的读完这篇文章,我们将为您提供更多参考使用或学习交流的信息。我们还可为您提供:企业网站建设、网站仿制、网站复制、仿站、外贸网站建设、外贸建站、公司官网制作等服务,本公司以“诚信、专业、务实、创新”的服务理念服务于客户。如您需要合作,请扫码咨询,我们将诚挚为您服务。
TAG标签: