唯一客服QQ:10297118
API接口[HTTP]

功能介紹

奶盤偽原創API是奶盤網為第三方開發人員提供的編程接口。
以往需要復制文章到奶盤網,偽原創后再粘貼到您要發布的網站?,F在奶盤開放了API,只要整合到您的網站,在您發布文章時,自動幫您做過奶盤偽原創,節省您的時間,讓您更好的用于網站維護!更強大的功能是奶盤開發的API還支持用戶自定義詞庫和關鍵字加鏈接的功能。

API請求地址

環境 請求方法 HTTP請求地址
正式環境 POST http://www.hzhdw.com/open/weiyuanchuang/towei.html

API請求結構

參數 類型 描述 示例值
regname String 購買的授權用戶 test@163.com
regsn String 購買的授權碼 ICQl3kdebh7zns97XVT9dLDBASR7pBrM2AAKbI7HpMw=
content String 需要偽原創的文章內容 新版奶盤SEO偽原創采用獨有的分詞引擎以及自創同義詞庫,模擬百度等中文切詞進行偽原創,生成后的偽原創文章更準確更貼近百度等搜索引擎收錄。

API返回結構

參數 類型 描述 示例值
result int 返回狀態 1 成功
-1 失敗
message String 返回錯誤信息 狀態為-1時,錯誤原因顯示
content String 偽原創后的文章內容 錯誤時返回原文

【UTF-8編碼】PHP整合代碼

   
       $url = 'http://www.hzhdw.com/open/weiyuanchuang/towei.html';  
       $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'];
        }

	echo $content;//偽原創后的文章內容
    

【GBK編碼】PHP整合代碼

   
       $url = 'http://www.hzhdw.com/open/weiyuanchuang/towei.html';  
       $content='您的文章內容';
        $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;//偽原創后的文章內容
    

JAVA整合代碼

   
       	public static void main(String[] args) {
		String url = "http://www.hzhdw.com/open/weiyuanchuang/towei.html";// 奶盤請求接口地址
		Map params = new HashMap();// 請求參數

		params.put("regname", "test@163.com");// 授權用戶
		params.put("regsn", "ICQl3kdebh7zns97XVT9dLDBASR7pBrM2AAKbI7HpMw=");// 授權碼
		params.put("content", "文章內容");// 文章內容

		String returnContent = "";
		try {
			returnContent = net(url, params, "POST");
			System.out.println(returnContent);// 返回json格式,如{"content":"文章內容","message":"偽原創成功!","result":1}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 *
	 * @param strUrl 請求地址
	 * @param params 請求參數
	 * @param method 請求方法
	 * @return 網絡請求字符串
	 * @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型轉為請求參數型
	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();
	}
    
如有疑問請聯系 技術支持

Copyright ? 2010-2020 NaiPan.com 奶盤SEO偽原創 All Right Reserved. 浙ICP備08017827號  浙公網安備 33010902000001號 專心、專注、專業,做偽原創行業的領跑者!

5g免费影院