Simsimi 小黄鸡机器人最新无限制接口api simsimi机器人接口api 微信公众号

1、什么是Simsimi?java

simsimi公司是提供智能服务,其中一个服务是simsimi聊天机器人服务,天天有超过百万的用户聊天,国内最大的搜索引擎——百度的产品siri使用的就是simsimi提供的api。web

你能够在网址http://www.simsimi.com/talk.htm# 进行体验apache

SimSimi inc. is specialized in collective intelligence service. All kinds of services we provide generates unique entertainment and values through systemized collective intelligence.编程

One of our services, a chatting robot SimSimi exceeds the limitation of technology of natural-language processing system by collective intelligence and it has a chat with over millions user per day. Our Premium knowledge providing service “Jisikman” creates millions of valuable knowledges a day.api

We invite you to our realm of service which is available through our cloud of collective intelligence, Crowd Cloud that SimSimi inc. creates.浏览器

2、Simsimi小黄鸡API微信

在 去年的这个时候,小黄鸡的非官方api一度被你们疯狂的在微信公众号上使用,一时间不知道成就了多少微信营销号,同时,华科某位大四学生利用这个api, 结合人人网开发平台,制做了一个小黄鸡的人人号,@小黄鸡以后,就能够利用api自动进行回复,是的这我的人号瞬间粉丝陡增。dom

然而你们使用的都是非官方的API,所谓非官方,就是否是simsimi公司提供的合法使用途径,API大体的原理是利用编程语言,模拟浏览器发送post请求到http://www.simsimi.com/talk.htm# 链 接,解析响应,而后做成相关的小黄鸡API。这个方法后来被我在本博客中在博文中发布,致使使用人数激增,simsimi公司彷佛察觉了什么,立马对这种 模拟请求的方式作出了屏蔽,一旦某ip请求数量和频率超过限制,则终端对它的请求。正式官方对非法API的封锁,也使用国内的开发这关注到以前并不出名的 小i机器人,一样使用语言模拟请求web聊天界面,时间没有过好久,这个页面就加入了图片验证码防止程序模拟。编程语言

至此,两个聊天机器人都走上了收费的道路...准确的说,应该是被这帮子开发者遇上了收费的道路,由于他们给它带来了知名度。ide

3、SimsimiAPI使用

目前,小黄鸡API已经公然收费(http://developer.simsimi.com/api)

不过,和以前同样,会给注册用户提供30天的试用API。

API请求连接为:

Trial-key    http://sandbox.api.simsimi.com/request.p

Paid-key    http://api.simsimi.com/request.p

API请求参数为:

Parameter Value Required Default Description
key String Y   Your key value
text String Y   Query message
lc String Y   Language code(List)
ft Double(0.0 ~ 1.0)   0.0 能够设置一个过滤器
0.0:未过滤(包含诅咒,性内容)
1.0:过滤不文明字句(暂时只支持韩文)
过滤内容,请访问下面的网站。 
https://www.webpurify.com/

API返回格式为:

result:100-ok. 400-Bad Request. 401-Unauthorized. 404-Not found. 500-Server Error.    返回的code

id:Response id. (you can get only if returning result is 100)回复的id,由系统生成,当请求成功返回时才有这个字段。 

response:Response message(you can get only if returning result is 100)返回的回复内容。

msg:Result  msg(Description of result code) 返回的code对应的含义

4、Simsimi使用举例

请求举例:

Trial-key    http://sandbox.api.simsimi.com/request.p?key=your_trial_key&lc=en&ft=1.0&text=hi    

Paid-key    http://api.simsimi.com/request.p?key=your_paid_key&lc=en&ft=1.0&text=hi

响应举例:

{ "result": 100, "response": "Who are you?!", "id": 13185569, "msg": "OK." }

5、如何免费的使用Simsimi API

我想,你们都懂了,写这篇文章的缘由就是不少人搜索小黄鸡 api到个人博客,我想你们都是要找免费的小黄鸡API。这里提供给你们一个思路:

 

合做伙伴中,有人人网,为何?本博文前面提升某大四学生作了一我的人号,@小黄鸡以后,会自动进行回复,他使用的就是simsimi的官方正版付费API,既然人人网提供开发平台,能够对账号进行回复,得到回复等等操做,为何不能使用程序,登陆账号,而后@小黄鸡,而后得到它的回复,再返回给你本身的用户呢?答案固然是能够的!!!

下面贴出一段可供参考的Java代码,之因此为仅供参考,就是说只能参考思路,代码运行是运行不起来的!!!

若是可以帮助到你,但愿回复点评一下,你懂的...

 
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
import  java.o.IOException;
import  java.util.ArrayList;
import  java.util.List;
import  java.util.Scanner;
import  java.util.regex.Matcher;
import  java.util.regex.Pattern;
import  org.apache.http.Header;
import  org.apache.http.HttpResponse;
import  org.apache.http.NameValuePair;
import  org.apache.http.client.ClientProtocolException;
import  org.apache.http.client.ResponseHandler;
import  org.apache.http.client.entity.UrlEncodedFormEntity;
import  org.apache.http.client.methods.HttpGet;
import  org.apache.http.client.methods.HttpPost;
import  org.apache.http.impl.client.BasicResponseHandler;
import  org.apache.http.impl.client.DefaultHttpClient;
import  org.apache.http.message.BasicNameValuePair;
import  org.apache.http.protocol.HTTP;
import  org.apache.http.util.EntityUtils;
/**
  * 利用httpclient操做人人网 好比登录,发状态,模拟你访问任何人主页等等
  * @author: http://50vip.com
 
  */
public  class  RenRen {
     private  String userName =  "" ;
     private  String password =  "" ;
     
     private  static  String redirectURL =  "http://www.renren.com/home" ;
     private  static  String renRenLoginURL =  "http://www.renren.com/PLogin.do" ;
     private  static  String talkUrl =  "http://photo.renren.com/photo/simsimiWebPagerChat" ;
     private  HttpResponse response;
     private  DefaultHttpClient httpclient =  null ;
     private  String requestToken =  null ;
     private  String _rtk =  null ;
     
     public  RenRen(String userName, String password) {
         this .userName = userName;
         this .password = password;
     }
     
     public  static  void  main(String[] args) {
         RenRen rr =  null ;
         rr =  new  RenRen( "xxxxx@hotmail.com" "yyyyy" );
         rr.login();
         System.out.println(rr.talk( "820" ));
     }
     /**
      * 登录
      * @author: http://50vip.com
      * @return
      */
     public  boolean  login() {
         if  (httpclient !=  null ) {
             return  true ;
         }
         httpclient =  null ;
         httpclient =  new  DefaultHttpClient();
         HttpPost httpost =  new  HttpPost(renRenLoginURL);
         // All the parameters post to the web site
         List<NameValuePair> nvps =  new  ArrayList<NameValuePair>();
         nvps.add( new  BasicNameValuePair( "origURL" , redirectURL));
         nvps.add( new  BasicNameValuePair( "domain" "renren.com" ));
         nvps.add( new  BasicNameValuePair( "autoLogin" "true" ));
         nvps.add( new  BasicNameValuePair( "formName" "" ));
         nvps.add( new  BasicNameValuePair( "method" "" ));
         nvps.add( new  BasicNameValuePair( "submit" "登陆" ));
         nvps.add( new  BasicNameValuePair( "email" , userName));
         nvps.add( new  BasicNameValuePair( "password" , password));
         try  {
             httpost.setEntity( new  UrlEncodedFormEntity(nvps, HTTP.UTF_8));
             response = httpclient.execute(httpost);
             //System.out.println(response);
             catch  (Exception e) {
             e.printStackTrace();
             return  false ;
         finally  {
             httpost.abort();
         }
         
         String redirectLocation = getRedirectLocation();
         if  (redirectLocation !=  null ) {
             // 跳到首页,登陆完成
             String indexHtml=getText(redirectLocation);
             
             //获取requestToken get_check:'-2062261917'
             Pattern pattern1 = Pattern.compile( "get_check:'(.*)',get_check_x" );
             Matcher m1 = pattern1.matcher(indexHtml);
             if  (m1.find()) {
             requestToken=m1.group( 1 );
             else  {
             System.out.println( "获取requestToken失败!" );
             }
             
             //"获取_rtk失败!"get_check_x:'50d55fbd'
             Pattern pattern2 = Pattern.compile( "get_check_x:'(.*)',env:" );
             Matcher m2 = pattern2.matcher(indexHtml);
             if  (m2.find()) {
                 _rtk=m2.group( 1 );
             else  {
                 System.out.println( "获取_rtk失败!" );
             }
         }
         return  true ;
     }
     
     /**
      * 和人人的小黄鸡交谈
      * @author: http://50vip.com
      * @param msg
      * @return
      */
     public  String talk(String msg) {
         String repMsg= "" ; //小黄的回复
         
         HttpPost httpost =  new  HttpPost(talkUrl);
         // All the parameters post to the web site
         List<NameValuePair> nvps =  new  ArrayList<NameValuePair>();
         nvps.add( new  BasicNameValuePair( "_rtk" , _rtk));
         nvps.add( new  BasicNameValuePair( "requestToken" , requestToken));
         nvps.add( new  BasicNameValuePair( "message" , msg));
         
         try  {
             ResponseHandler<String> responseHandler =  new  BasicResponseHandler();
             httpost.setEntity( new  UrlEncodedFormEntity(nvps, HTTP.UTF_8));
             repMsg=httpclient.execute(httpost, responseHandler);
         catch  (Exception e) {
             e.printStackTrace();
         finally  {
             httpost.abort();
         }
         return  repMsg;
     }
     
     /**
      * 此处人人网会302跳转
      * @author: http://50vip.com
      * @return
      */
     private  String getRedirectLocation() {
         Header locationHeader = response.getFirstHeader( "Location" );
         if  (locationHeader ==  null ) {
             return  null ;
         }
         return  locationHeader.getValue();
     }
     
     /**
      * 读取首页内容
      * @author: http://50vip.com
      * @param redirectLocation
      * @return
      */
     private  String getText(String redirectLocation) {
         HttpGet httpget =  new  HttpGet(redirectLocation);
         // Create a response handler
         ResponseHandler<String> responseHandler =  new  BasicResponseHandler();
         String responseBody =  "" ;
         try  {
             responseBody = httpclient.execute(httpget, responseHandler);
         catch  (Exception e) {
             e.printStackTrace();
             responseBody =  null ;
         finally  {
             httpget.abort();
         }
         return  responseBody;
     }
}
相关文章
相关标签/搜索