開放API > API接口[HTTP]
功能介紹
奶盤偽原創(chuàng)API是奶盤網(wǎng)為第三方開發(fā)人員提供的編程接口。
以往需要復(fù)制文章到奶盤網(wǎng),偽原創(chuàng)后再粘貼到您要發(fā)布的網(wǎng)站。現(xiàn)在奶盤開放了API,只要整合到您的網(wǎng)站,在您發(fā)布文章時(shí),自動(dòng)幫您做過奶盤偽原創(chuàng),節(jié)省您的時(shí)間,讓您更好的用于網(wǎng)站維護(hù)!更強(qiáng)大的功能是奶盤開發(fā)的API還支持用戶自定義詞庫(kù)和關(guān)鍵字加鏈接的功能。
API請(qǐng)求地址
| 環(huán)境 | 請(qǐng)求方法 | HTTP請(qǐng)求地址 |
|---|---|---|
| 正式環(huán)境 | POST | http://www.4144444.com/open/weiyuanchuang/towei.html |
API請(qǐng)求結(jié)構(gòu)
| 參數(shù) | 類型 | 描述 | 示例值 |
|---|---|---|---|
| regname | String | 購(gòu)買的授權(quán)用戶 | test@163.com |
| regsn | String | 購(gòu)買的授權(quán)碼 | ICQl3kdebh7zns97XVT9dLDBASR7pBrM2AAKbI7HpMw= |
| content | String | 需要偽原創(chuàng)的文章內(nèi)容 | 新版奶盤SEO偽原創(chuàng)采用獨(dú)有的分詞引擎以及自創(chuàng)同義詞庫(kù),模擬百度等中文切詞進(jìn)行偽原創(chuàng),生成后的偽原創(chuàng)文章更準(zhǔn)確更貼近百度等搜索引擎收錄。 |
API返回結(jié)構(gòu)
| 參數(shù) | 類型 | 描述 | 示例值 |
|---|---|---|---|
| result | int | 返回狀態(tài) | 1 成功 -1 失敗 |
| message | String | 返回錯(cuò)誤信息 | 狀態(tài)為-1時(shí),錯(cuò)誤原因顯示 |
| content | String | 偽原創(chuàng)后的文章內(nèi)容 | 錯(cuò)誤時(shí)返回原文 |
【UTF-8編碼】PHP整合代碼
$url = 'http://www.4144444.com/open/weiyuanchuang/towei.html';
$content='您的文章內(nèi)容';
$data = array(
'regname'=>'test@163.com',
'regsn'=>'ICQl3kdebh7zns97XVT9dLDBASR7pBrM2AAKbI7HpMw=',
'content'=>$content
);
$ch = curl_init();
$timeout = 5000;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$handles = curl_exec($ch);
curl_close($ch);
$json_data = $handles;
$array = json_decode($json_data,true);
if($array['result']==1){
$content=$array['content'];
}
echo $content;//偽原創(chuàng)后的文章內(nèi)容
【GBK編碼】PHP整合代碼
$url = 'http://www.4144444.com/open/weiyuanchuang/towei.html';
$content='您的文章內(nèi)容';
$content= iconv('gbk','utf-8',$content);
$data = array(
'regname'=>'test@163.com',
'regsn'=>'ICQl3kdebh7zns97XVT9dLDBASR7pBrM2AAKbI7HpMw=',
'content'=>$content
);
$ch = curl_init();
$timeout = 5000;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$handles = curl_exec($ch);
curl_close($ch);
$json_data = $handles;
$array = json_decode($json_data,true);
if($array['result']==1){
$content=$array['content'];
$content= iconv('utf-8','gbk',$content);
}
echo $content;//偽原創(chuàng)后的文章內(nèi)容
python整合代碼
import requests
import json
url="http://www.4144444.com/open/weiyuanchuang/towei.html"
content='您的文章內(nèi)容'
data={
"regname":"test@163.com",
'regsn':"ICQl3kdebh7zns97XVT9dLDBASR7pBrM2AAKbI7HpMw=",
'content':content
}
res=requests.post(url,data=data)
jsonh=json.loads(res.text)
print(jsonh["content"])//偽原創(chuàng)后的文章內(nèi)容
JAVA整合代碼
public static void main(String[] args) {
String url = "http://www.4144444.com/open/weiyuanchuang/towei.html";// 奶盤請(qǐng)求接口地址
Map params = new HashMap();// 請(qǐng)求參數(shù)
params.put("regname", "test@163.com");// 授權(quán)用戶
params.put("regsn", "ICQl3kdebh7zns97XVT9dLDBASR7pBrM2AAKbI7HpMw=");// 授權(quán)碼
params.put("content", "文章內(nèi)容");// 文章內(nèi)容
String returnContent = "";
try {
returnContent = net(url, params, "POST");
System.out.println(returnContent);// 返回json格式,如{"content":"文章內(nèi)容","message":"偽原創(chuàng)成功!","result":1}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
*
* @param strUrl 請(qǐng)求地址
* @param params 請(qǐng)求參數(shù)
* @param method 請(qǐng)求方法
* @return 網(wǎng)絡(luò)請(qǐng)求字符串
* @throws Exception
*/
public static String net(String strUrl, Map params, String method)
throws Exception {
final String DEF_CHATSET = "UTF-8";
final int DEF_CONN_TIMEOUT = 30000;
final int DEF_READ_TIMEOUT = 30000;
String userAgent = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.66 Safari/537.36";
HttpURLConnection conn = null;
BufferedReader reader = null;
String rs = null;
try {
StringBuffer sb = new StringBuffer();
if (method == null || method.equals("GET")) {
strUrl = strUrl + "?" + urlencode(params);
}
URL url = new URL(strUrl);
conn = (HttpURLConnection) url.openConnection();
if (method == null || method.equals("GET")) {
conn.setRequestMethod("GET");
} else {
conn.setRequestMethod("POST");
conn.setDoOutput(true);
}
conn.setRequestProperty("User-agent", userAgent);
conn.setUseCaches(false);
conn.setConnectTimeout(DEF_CONN_TIMEOUT);
conn.setReadTimeout(DEF_READ_TIMEOUT);
conn.setInstanceFollowRedirects(false);
conn.connect();
if (params != null && method.equals("POST")) {
try {
DataOutputStream out = new DataOutputStream(
conn.getOutputStream());
out.writeBytes(urlencode(params));
} catch (Exception e) {
e.printStackTrace();
}
}
InputStream is = conn.getInputStream();
reader = new BufferedReader(new InputStreamReader(is, DEF_CHATSET));
String strRead = null;
while ((strRead = reader.readLine()) != null) {
sb.append(strRead);
}
rs = sb.toString();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (reader != null) {
reader.close();
}
if (conn != null) {
conn.disconnect();
}
}
return rs;
}
// 將map型轉(zhuǎn)為請(qǐng)求參數(shù)型
public static String urlencode(Map data) {
StringBuilder sb = new StringBuilder();
for (Map.Entry i : data.entrySet()) {
try {
sb.append(i.getKey()).append("=")
.append(URLEncoder.encode(i.getValue() + "", "UTF-8"))
.append("&");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
return sb.toString();
}


浙公網(wǎng)安備 33010902000001號(hào)