File tree Expand file tree Collapse file tree 3 files changed +50
-0
lines changed
Expand file tree Collapse file tree 3 files changed +50
-0
lines changed Original file line number Diff line number Diff line change 1+ import requests
2+
3+ send_data = {
4+ "question" : '你的梦想是什么?' , #构建发送的数据
5+ "api_key" : "a6ec389908bcc23fceb2bbe998e3313e" ,
6+ "api_secret" : "bsa0yv06pl1p"
7+ }
8+ api_url = 'http://i.itpk.cn/api.php'
9+ chat_content = requests .post (api_url , data = send_data ) #发送请求数据
10+ print (chat_content .text )
Original file line number Diff line number Diff line change 1+ import requests
2+
3+ send_data = {
4+ "key" : "9fd874929409453991db78f8b46a446b" ,
5+ "info" : '我叫你一声你敢答应吗' , #构建发送的数据
6+ "userid" : "622952"
7+ }
8+ api_url = 'http://www.tuling123.com/openapi/api'
9+ chat_content = requests .post (api_url , data = send_data ) #发送请求数据
10+ print (chat_content .text )
Original file line number Diff line number Diff line change 1+ import requests
2+ import time
3+
4+ question = input ("请开始你们的表演:" ) # 输入问题开始表演
5+
6+ girl = "小姐姐"
7+ boy = "小哥哥"
8+
9+ print (boy + ':' + question )
10+
11+ while True :
12+ boy_data = {
13+ "key" : "9fd874929409453991db78f8b46a446b" ,
14+ "info" : question , #构建发送的数据
15+ "userid" : "622952"
16+ }
17+ boy_url = 'http://www.tuling123.com/openapi/api'
18+ boy_content = requests .post (boy_url , data = boy_data ) #发送请求数据
19+ print (boy + ':' + eval (boy_content .text )["text" ]) # 用eval函数处理一下图灵返回的消息
20+ question = eval (boy_content .text )["text" ]
21+
22+ girl_data = {
23+ "question" : question , # 构建发送的数据
24+ "api_key" : "a6ec389908bcc23fceb2bbe998e3313e" ,
25+ "api_secret" : "bsa0yv06pl1p"
26+ }
27+ girl_url = 'http://i.itpk.cn/api.php'
28+ girl_content = requests .post (girl_url , data = girl_data ) # 发送请求数据
29+ print (girl + ':' + girl_content .text )
30+ time .sleep (3 )
You can’t perform that action at this time.
0 commit comments