質問編集履歴

10

投稿ミス

2018/10/09 10:47

投稿

senju-jjj
senju-jjj

スコア13

test CHANGED
File without changes
test CHANGED
@@ -54,6 +54,8 @@
54
54
 
55
55
  試したこと
56
56
 
57
+ ```
58
+
57
59
  herokuのログです
58
60
 
59
61
 
@@ -79,3 +81,5 @@
79
81
  2018-10-06T04:58:04.072054+00:00 heroku[router]: at=info method=POST path="/bot/" host=infinite-oasis-41928.herokuapp.com request_id=d2e3852c-b9c4-4b35-a73e-96f8eec347f3 fwd="203.104.146.156" dyno=web.1 connect=1ms service=2ms status=200 bytes=205 protocol=https
80
82
 
81
83
  2018-10-06T04:58:04.071313+00:00 app[web.1]: 10.11.176.130 - - [06/Oct/2018:04:58:04 +0000] "POST /bot/ HTTP/1.1" 200 16 "-" "LineBotWebhook/1.0"
84
+
85
+ ```

9

投稿ミス

2018/10/09 10:47

投稿

senju-jjj
senju-jjj

スコア13

test CHANGED
File without changes
test CHANGED
@@ -9,376 +9,6 @@
9
9
  ```python
10
10
 
11
11
  コード
12
-
13
- views.py
14
-
15
- # -*- encoding: utf-8 -*-
16
-
17
- import json
18
-
19
- import requests
20
-
21
- import sys
22
-
23
- import pya3rt
24
-
25
- from django.http import HttpResponse
26
-
27
- from linebot import LineBotApi
28
-
29
- from PIL import Image
30
-
31
- from io import BytesIO
32
-
33
-
34
-
35
-
36
-
37
-
38
-
39
- sys.path.append('./bot')
40
-
41
-
42
-
43
- REPLY_ENDPOINT = 'https://api.line.me/v2/bot/message/reply'
44
-
45
- ACCESS_TOKEN = ''
46
-
47
- HEADER = {
48
-
49
- "Content-Type": "application/json",
50
-
51
- "Authorization": "Bearer " + ACCESS_TOKEN
52
-
53
- }
54
-
55
- lINE_BOT_API = LineBotApi(ACCESS_TOKEN)
56
-
57
-
58
-
59
- # recuitAPI
60
-
61
- recuitapikey = ""
62
-
63
- client = pya3rt.TalkClient(recuitapikey)
64
-
65
-
66
-
67
- # docomoAPI
68
-
69
- docomoapikey = ''
70
-
71
-
72
-
73
- print ('test2')
74
-
75
-
76
-
77
- # Get API_Path
78
-
79
- def __build_url(name, version='v1'):
80
-
81
- return __api_path.format({'version': version, 'name': name})
82
-
83
-
84
-
85
- __api_path = 'https://api.apigw.smt.docomo.ne.jp/imageRecognition/{0[version]}/{0[name]}'
86
-
87
-
88
-
89
-
90
-
91
- def index(request):
92
-
93
- return HttpResponse("This is bot api.")
94
-
95
-
96
-
97
- # Reply text
98
-
99
- def reply_text(reply_token, rep_meg):
100
-
101
- payload = {
102
-
103
- "replyToken": reply_token,
104
-
105
- "messages": [
106
-
107
- {
108
-
109
- "type": "text",
110
-
111
- "text": rep_meg
112
-
113
- }
114
-
115
- ]
116
-
117
- }
118
-
119
-
120
-
121
- print ('test3')
122
-
123
-
124
-
125
- requests.post(REPLY_ENDPOINT, headers=HEADER, data=json.dumps(payload)) # to send data to LINE
126
-
127
- return rep_meg
128
-
129
-
130
-
131
-
132
-
133
- # Save image
134
-
135
- def save_image(messegeid):
136
-
137
- message_content = lINE_BOT_API.get_message_content(messegeid)
138
-
139
-
140
-
141
- i = Image.open(BytesIO(message_content.content))
142
-
143
- filename = '/tmp/' + messegeid + '.jpg'
144
-
145
- i.save(filename)
146
-
147
-
148
-
149
- return filename
150
-
151
-
152
-
153
- # Get json
154
-
155
- def get_json(filename):
156
-
157
- with open(filename, mode='rb') as f:
158
-
159
- result = requests.post(
160
-
161
- url=__build_url('recognize'),
162
-
163
- params={'APIKEY': docomoapikey, 'recog': 'product-all', 'numOfCandidates': 5},
164
-
165
- data=f,
166
-
167
- headers={'Content-Type': 'application/octet-stream'})
168
-
169
- result.raise_for_status()
170
-
171
- result = result.json()
172
-
173
- return result
174
-
175
-
176
-
177
- # Reply carousel
178
-
179
- def post_carousel(reply_token,imageUrl,title,brand,releaseDate,maker,url,itmeName):
180
-
181
- payload = {
182
-
183
- "replyToken":reply_token,
184
-
185
- "messages":[
186
-
187
- {
188
-
189
- "type": "template",
190
-
191
- "altText": "商品結果",
192
-
193
- "template": {
194
-
195
- "type": "carousel",
196
-
197
- "columns": [
198
-
199
-
200
-
201
- {
202
-
203
- "thumbnailImageUrl": imageUrl[0],
204
-
205
- "title": itmeName[0],
206
-
207
- "text": "ブランド名:" + brand[0] + " メーカー名:"+ maker[0] +" 発売日:" +releaseDate[0],
208
-
209
- "actions": [
210
-
211
-
212
-
213
- {
214
-
215
- "type": "uri",
216
-
217
- "label": "Amazonで見る",
218
-
219
- "uri": url[0]
220
-
221
- }
222
-
223
- ]
224
-
225
- },
226
-
227
- {
228
-
229
- "thumbnailImageUrl": imageUrl[1],
230
-
231
- "title": itmeName[1],
232
-
233
- "text": "ブランド名:" + brand[1] + " メーカー名:"+ maker[1] +" 発売日:" +releaseDate[1],
234
-
235
- "actions": [
236
-
237
-
238
-
239
- {
240
-
241
- "type": "uri",
242
-
243
- "label": "Amazonで見る",
244
-
245
- "uri": url[1]
246
-
247
- }
248
-
249
- ]
250
-
251
- },
252
-
253
- {
254
-
255
- "thumbnailImageUrl": imageUrl[2],
256
-
257
- "title": itmeName[2],
258
-
259
- "text": "ブランド名:" + brand[2] + " メーカー名:"+ maker[2] +" 発売日:" +releaseDate[2],
260
-
261
- "actions": [
262
-
263
-
264
-
265
- {
266
-
267
- "type": "uri",
268
-
269
- "label": "Amazonで見る",
270
-
271
- "uri": url[2]
272
-
273
- }
274
-
275
- ]
276
-
277
- }
278
-
279
- ]
280
-
281
- }
282
-
283
- }
284
-
285
- ]
286
-
287
- }
288
-
289
- req = requests.post(REPLY_ENDPOINT, headers=HEADER, data=json.dumps(payload))
290
-
291
- return title[0]
292
-
293
-
294
-
295
-
296
-
297
- def callback(request):
298
-
299
- reply = ""
300
-
301
- request_json = json.loads(request.body.decode('utf-8')) # to get json
302
-
303
-
304
-
305
- print ('test1')
306
-
307
-
308
-
309
- for e in request_json['events']:
310
-
311
- reply_token = e['replyToken'] # to get reply_token
312
-
313
- message_type = e['message']['type'] # to get type
314
-
315
-
316
-
317
- # reply for test
318
-
319
- if message_type == 'text':
320
-
321
-
322
-
323
- text = e['message']['text'] # to get message
324
-
325
- rep_meg = client.talk(text)["results"][0]["reply"] # to get reply message by recuitTalk
326
-
327
- reply += reply_text(reply_token, rep_meg)
328
-
329
-
330
-
331
- # reply for image
332
-
333
- if message_type == 'image':
334
-
335
- messegeid = e['message']['id'] # to get messageID
336
-
337
- filename = save_image(messegeid)
338
-
339
- result = get_json(filename)
340
-
341
-
342
-
343
- if (result.get('candidates') != None):
344
-
345
- imageUrl,title,brand,releaseDate,maker,url,itemName =[],[],[],[],[],[],[]
346
-
347
-
348
-
349
- for i in range(0,3): # to get item info
350
-
351
- imageUrl.append(result['candidates'][i]['imageUrl'])
352
-
353
- title.append(result['candidates'][i]['sites'][0]['title'])
354
-
355
- brand.append(result['candidates'][i]['detail']['brand'])
356
-
357
- releaseDate.append(result['candidates'][i]['detail']['releaseDate'])
358
-
359
- maker.append(result['candidates'][0]['detail']['maker'])
360
-
361
- url.append(result['candidates'][i]['sites'][0]['url'])
362
-
363
- itemName.append(result['candidates'][i]['detail']['itemName'][0:29]) # to restrict length
364
-
365
-
366
-
367
- reply += post_carousel(reply_token,imageUrl,title,brand,releaseDate,maker,url,itemName)
368
-
369
-
370
-
371
- else:
372
-
373
- rep_meg = "お探しのものは見つかりませんでした。"
374
-
375
- reply += reply_text(reply_token, rep_meg)
376
-
377
-
378
-
379
- return HttpResponse(reply) # for test
380
-
381
-
382
12
 
383
13
 
384
14
 

8

a

2018/10/09 10:46

投稿

senju-jjj
senju-jjj

スコア13

test CHANGED
File without changes
test CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  コード
12
12
 
13
-
13
+ views.py
14
14
 
15
15
  # -*- encoding: utf-8 -*-
16
16
 
@@ -378,6 +378,48 @@
378
378
 
379
379
  return HttpResponse(reply) # for test
380
380
 
381
+
382
+
383
+
384
+
385
+ urls.py
386
+
387
+
388
+
389
+ from django.conf.urls import url
390
+
391
+
392
+
393
+ from . import views
394
+
395
+
396
+
397
+ urlpatterns = [
398
+
399
+ url(r'^$', views.index, name="index"),
400
+
401
+ url(r'^callback', views.callback),
402
+
403
+ ]
404
+
405
+
406
+
407
+ '''
408
+
409
+ urlpatterns = [
410
+
411
+ path('callback/', views.callback),
412
+
413
+ path('index/', views.index),
414
+
415
+ ]
416
+
417
+ '''
418
+
419
+
420
+
421
+
422
+
381
423
  ```
382
424
 
383
425
  試したこと

7

misu

2018/10/06 05:50

投稿

senju-jjj
senju-jjj

スコア13

test CHANGED
File without changes
test CHANGED
@@ -10,376 +10,376 @@
10
10
 
11
11
  コード
12
12
 
13
+
14
+
15
+ # -*- encoding: utf-8 -*-
16
+
17
+ import json
18
+
19
+ import requests
20
+
21
+ import sys
22
+
23
+ import pya3rt
24
+
25
+ from django.http import HttpResponse
26
+
27
+ from linebot import LineBotApi
28
+
29
+ from PIL import Image
30
+
31
+ from io import BytesIO
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+ sys.path.append('./bot')
40
+
41
+
42
+
43
+ REPLY_ENDPOINT = 'https://api.line.me/v2/bot/message/reply'
44
+
45
+ ACCESS_TOKEN = ''
46
+
47
+ HEADER = {
48
+
49
+ "Content-Type": "application/json",
50
+
51
+ "Authorization": "Bearer " + ACCESS_TOKEN
52
+
53
+ }
54
+
55
+ lINE_BOT_API = LineBotApi(ACCESS_TOKEN)
56
+
57
+
58
+
59
+ # recuitAPI
60
+
61
+ recuitapikey = ""
62
+
63
+ client = pya3rt.TalkClient(recuitapikey)
64
+
65
+
66
+
67
+ # docomoAPI
68
+
69
+ docomoapikey = ''
70
+
71
+
72
+
73
+ print ('test2')
74
+
75
+
76
+
77
+ # Get API_Path
78
+
79
+ def __build_url(name, version='v1'):
80
+
81
+ return __api_path.format({'version': version, 'name': name})
82
+
83
+
84
+
85
+ __api_path = 'https://api.apigw.smt.docomo.ne.jp/imageRecognition/{0[version]}/{0[name]}'
86
+
87
+
88
+
89
+
90
+
91
+ def index(request):
92
+
93
+ return HttpResponse("This is bot api.")
94
+
95
+
96
+
97
+ # Reply text
98
+
99
+ def reply_text(reply_token, rep_meg):
100
+
101
+ payload = {
102
+
103
+ "replyToken": reply_token,
104
+
105
+ "messages": [
106
+
107
+ {
108
+
109
+ "type": "text",
110
+
111
+ "text": rep_meg
112
+
113
+ }
114
+
115
+ ]
116
+
117
+ }
118
+
119
+
120
+
121
+ print ('test3')
122
+
123
+
124
+
125
+ requests.post(REPLY_ENDPOINT, headers=HEADER, data=json.dumps(payload)) # to send data to LINE
126
+
127
+ return rep_meg
128
+
129
+
130
+
131
+
132
+
133
+ # Save image
134
+
135
+ def save_image(messegeid):
136
+
137
+ message_content = lINE_BOT_API.get_message_content(messegeid)
138
+
139
+
140
+
141
+ i = Image.open(BytesIO(message_content.content))
142
+
143
+ filename = '/tmp/' + messegeid + '.jpg'
144
+
145
+ i.save(filename)
146
+
147
+
148
+
149
+ return filename
150
+
151
+
152
+
153
+ # Get json
154
+
155
+ def get_json(filename):
156
+
157
+ with open(filename, mode='rb') as f:
158
+
159
+ result = requests.post(
160
+
161
+ url=__build_url('recognize'),
162
+
163
+ params={'APIKEY': docomoapikey, 'recog': 'product-all', 'numOfCandidates': 5},
164
+
165
+ data=f,
166
+
167
+ headers={'Content-Type': 'application/octet-stream'})
168
+
169
+ result.raise_for_status()
170
+
171
+ result = result.json()
172
+
173
+ return result
174
+
175
+
176
+
177
+ # Reply carousel
178
+
179
+ def post_carousel(reply_token,imageUrl,title,brand,releaseDate,maker,url,itmeName):
180
+
181
+ payload = {
182
+
183
+ "replyToken":reply_token,
184
+
185
+ "messages":[
186
+
187
+ {
188
+
189
+ "type": "template",
190
+
191
+ "altText": "商品結果",
192
+
193
+ "template": {
194
+
195
+ "type": "carousel",
196
+
197
+ "columns": [
198
+
199
+
200
+
201
+ {
202
+
203
+ "thumbnailImageUrl": imageUrl[0],
204
+
205
+ "title": itmeName[0],
206
+
207
+ "text": "ブランド名:" + brand[0] + " メーカー名:"+ maker[0] +" 発売日:" +releaseDate[0],
208
+
209
+ "actions": [
210
+
211
+
212
+
213
+ {
214
+
215
+ "type": "uri",
216
+
217
+ "label": "Amazonで見る",
218
+
219
+ "uri": url[0]
220
+
221
+ }
222
+
223
+ ]
224
+
225
+ },
226
+
227
+ {
228
+
229
+ "thumbnailImageUrl": imageUrl[1],
230
+
231
+ "title": itmeName[1],
232
+
233
+ "text": "ブランド名:" + brand[1] + " メーカー名:"+ maker[1] +" 発売日:" +releaseDate[1],
234
+
235
+ "actions": [
236
+
237
+
238
+
239
+ {
240
+
241
+ "type": "uri",
242
+
243
+ "label": "Amazonで見る",
244
+
245
+ "uri": url[1]
246
+
247
+ }
248
+
249
+ ]
250
+
251
+ },
252
+
253
+ {
254
+
255
+ "thumbnailImageUrl": imageUrl[2],
256
+
257
+ "title": itmeName[2],
258
+
259
+ "text": "ブランド名:" + brand[2] + " メーカー名:"+ maker[2] +" 発売日:" +releaseDate[2],
260
+
261
+ "actions": [
262
+
263
+
264
+
265
+ {
266
+
267
+ "type": "uri",
268
+
269
+ "label": "Amazonで見る",
270
+
271
+ "uri": url[2]
272
+
273
+ }
274
+
275
+ ]
276
+
277
+ }
278
+
279
+ ]
280
+
281
+ }
282
+
283
+ }
284
+
285
+ ]
286
+
287
+ }
288
+
289
+ req = requests.post(REPLY_ENDPOINT, headers=HEADER, data=json.dumps(payload))
290
+
291
+ return title[0]
292
+
293
+
294
+
295
+
296
+
297
+ def callback(request):
298
+
299
+ reply = ""
300
+
301
+ request_json = json.loads(request.body.decode('utf-8')) # to get json
302
+
303
+
304
+
305
+ print ('test1')
306
+
307
+
308
+
309
+ for e in request_json['events']:
310
+
311
+ reply_token = e['replyToken'] # to get reply_token
312
+
313
+ message_type = e['message']['type'] # to get type
314
+
315
+
316
+
317
+ # reply for test
318
+
319
+ if message_type == 'text':
320
+
321
+
322
+
323
+ text = e['message']['text'] # to get message
324
+
325
+ rep_meg = client.talk(text)["results"][0]["reply"] # to get reply message by recuitTalk
326
+
327
+ reply += reply_text(reply_token, rep_meg)
328
+
329
+
330
+
331
+ # reply for image
332
+
333
+ if message_type == 'image':
334
+
335
+ messegeid = e['message']['id'] # to get messageID
336
+
337
+ filename = save_image(messegeid)
338
+
339
+ result = get_json(filename)
340
+
341
+
342
+
343
+ if (result.get('candidates') != None):
344
+
345
+ imageUrl,title,brand,releaseDate,maker,url,itemName =[],[],[],[],[],[],[]
346
+
347
+
348
+
349
+ for i in range(0,3): # to get item info
350
+
351
+ imageUrl.append(result['candidates'][i]['imageUrl'])
352
+
353
+ title.append(result['candidates'][i]['sites'][0]['title'])
354
+
355
+ brand.append(result['candidates'][i]['detail']['brand'])
356
+
357
+ releaseDate.append(result['candidates'][i]['detail']['releaseDate'])
358
+
359
+ maker.append(result['candidates'][0]['detail']['maker'])
360
+
361
+ url.append(result['candidates'][i]['sites'][0]['url'])
362
+
363
+ itemName.append(result['candidates'][i]['detail']['itemName'][0:29]) # to restrict length
364
+
365
+
366
+
367
+ reply += post_carousel(reply_token,imageUrl,title,brand,releaseDate,maker,url,itemName)
368
+
369
+
370
+
371
+ else:
372
+
373
+ rep_meg = "お探しのものは見つかりませんでした。"
374
+
375
+ reply += reply_text(reply_token, rep_meg)
376
+
377
+
378
+
379
+ return HttpResponse(reply) # for test
380
+
13
381
  ```
14
382
 
15
- # -*- encoding: utf-8 -*-
16
-
17
- import json
18
-
19
- import requests
20
-
21
- import sys
22
-
23
- import pya3rt
24
-
25
- from django.http import HttpResponse
26
-
27
- from linebot import LineBotApi
28
-
29
- from PIL import Image
30
-
31
- from io import BytesIO
32
-
33
-
34
-
35
-
36
-
37
-
38
-
39
- sys.path.append('./bot')
40
-
41
-
42
-
43
- REPLY_ENDPOINT = 'https://api.line.me/v2/bot/message/reply'
44
-
45
- ACCESS_TOKEN = ''
46
-
47
- HEADER = {
48
-
49
- "Content-Type": "application/json",
50
-
51
- "Authorization": "Bearer " + ACCESS_TOKEN
52
-
53
- }
54
-
55
- lINE_BOT_API = LineBotApi(ACCESS_TOKEN)
56
-
57
-
58
-
59
- # recuitAPI
60
-
61
- recuitapikey = ""
62
-
63
- client = pya3rt.TalkClient(recuitapikey)
64
-
65
-
66
-
67
- # docomoAPI
68
-
69
- docomoapikey = ''
70
-
71
-
72
-
73
- print ('test2')
74
-
75
-
76
-
77
- # Get API_Path
78
-
79
- def __build_url(name, version='v1'):
80
-
81
- return __api_path.format({'version': version, 'name': name})
82
-
83
-
84
-
85
- __api_path = 'https://api.apigw.smt.docomo.ne.jp/imageRecognition/{0[version]}/{0[name]}'
86
-
87
-
88
-
89
-
90
-
91
- def index(request):
92
-
93
- return HttpResponse("This is bot api.")
94
-
95
-
96
-
97
- # Reply text
98
-
99
- def reply_text(reply_token, rep_meg):
100
-
101
- payload = {
102
-
103
- "replyToken": reply_token,
104
-
105
- "messages": [
106
-
107
- {
108
-
109
- "type": "text",
110
-
111
- "text": rep_meg
112
-
113
- }
114
-
115
- ]
116
-
117
- }
118
-
119
-
120
-
121
- print ('test3')
122
-
123
-
124
-
125
- requests.post(REPLY_ENDPOINT, headers=HEADER, data=json.dumps(payload)) # to send data to LINE
126
-
127
- return rep_meg
128
-
129
-
130
-
131
-
132
-
133
- # Save image
134
-
135
- def save_image(messegeid):
136
-
137
- message_content = lINE_BOT_API.get_message_content(messegeid)
138
-
139
-
140
-
141
- i = Image.open(BytesIO(message_content.content))
142
-
143
- filename = '/tmp/' + messegeid + '.jpg'
144
-
145
- i.save(filename)
146
-
147
-
148
-
149
- return filename
150
-
151
-
152
-
153
- # Get json
154
-
155
- def get_json(filename):
156
-
157
- with open(filename, mode='rb') as f:
158
-
159
- result = requests.post(
160
-
161
- url=__build_url('recognize'),
162
-
163
- params={'APIKEY': docomoapikey, 'recog': 'product-all', 'numOfCandidates': 5},
164
-
165
- data=f,
166
-
167
- headers={'Content-Type': 'application/octet-stream'})
168
-
169
- result.raise_for_status()
170
-
171
- result = result.json()
172
-
173
- return result
174
-
175
-
176
-
177
- # Reply carousel
178
-
179
- def post_carousel(reply_token,imageUrl,title,brand,releaseDate,maker,url,itmeName):
180
-
181
- payload = {
182
-
183
- "replyToken":reply_token,
184
-
185
- "messages":[
186
-
187
- {
188
-
189
- "type": "template",
190
-
191
- "altText": "商品結果",
192
-
193
- "template": {
194
-
195
- "type": "carousel",
196
-
197
- "columns": [
198
-
199
-
200
-
201
- {
202
-
203
- "thumbnailImageUrl": imageUrl[0],
204
-
205
- "title": itmeName[0],
206
-
207
- "text": "ブランド名:" + brand[0] + " メーカー名:"+ maker[0] +" 発売日:" +releaseDate[0],
208
-
209
- "actions": [
210
-
211
-
212
-
213
- {
214
-
215
- "type": "uri",
216
-
217
- "label": "Amazonで見る",
218
-
219
- "uri": url[0]
220
-
221
- }
222
-
223
- ]
224
-
225
- },
226
-
227
- {
228
-
229
- "thumbnailImageUrl": imageUrl[1],
230
-
231
- "title": itmeName[1],
232
-
233
- "text": "ブランド名:" + brand[1] + " メーカー名:"+ maker[1] +" 発売日:" +releaseDate[1],
234
-
235
- "actions": [
236
-
237
-
238
-
239
- {
240
-
241
- "type": "uri",
242
-
243
- "label": "Amazonで見る",
244
-
245
- "uri": url[1]
246
-
247
- }
248
-
249
- ]
250
-
251
- },
252
-
253
- {
254
-
255
- "thumbnailImageUrl": imageUrl[2],
256
-
257
- "title": itmeName[2],
258
-
259
- "text": "ブランド名:" + brand[2] + " メーカー名:"+ maker[2] +" 発売日:" +releaseDate[2],
260
-
261
- "actions": [
262
-
263
-
264
-
265
- {
266
-
267
- "type": "uri",
268
-
269
- "label": "Amazonで見る",
270
-
271
- "uri": url[2]
272
-
273
- }
274
-
275
- ]
276
-
277
- }
278
-
279
- ]
280
-
281
- }
282
-
283
- }
284
-
285
- ]
286
-
287
- }
288
-
289
- req = requests.post(REPLY_ENDPOINT, headers=HEADER, data=json.dumps(payload))
290
-
291
- return title[0]
292
-
293
-
294
-
295
-
296
-
297
- def callback(request):
298
-
299
- reply = ""
300
-
301
- request_json = json.loads(request.body.decode('utf-8')) # to get json
302
-
303
-
304
-
305
- print ('test1')
306
-
307
-
308
-
309
- for e in request_json['events']:
310
-
311
- reply_token = e['replyToken'] # to get reply_token
312
-
313
- message_type = e['message']['type'] # to get type
314
-
315
-
316
-
317
- # reply for test
318
-
319
- if message_type == 'text':
320
-
321
-
322
-
323
- text = e['message']['text'] # to get message
324
-
325
- rep_meg = client.talk(text)["results"][0]["reply"] # to get reply message by recuitTalk
326
-
327
- reply += reply_text(reply_token, rep_meg)
328
-
329
-
330
-
331
- # reply for image
332
-
333
- if message_type == 'image':
334
-
335
- messegeid = e['message']['id'] # to get messageID
336
-
337
- filename = save_image(messegeid)
338
-
339
- result = get_json(filename)
340
-
341
-
342
-
343
- if (result.get('candidates') != None):
344
-
345
- imageUrl,title,brand,releaseDate,maker,url,itemName =[],[],[],[],[],[],[]
346
-
347
-
348
-
349
- for i in range(0,3): # to get item info
350
-
351
- imageUrl.append(result['candidates'][i]['imageUrl'])
352
-
353
- title.append(result['candidates'][i]['sites'][0]['title'])
354
-
355
- brand.append(result['candidates'][i]['detail']['brand'])
356
-
357
- releaseDate.append(result['candidates'][i]['detail']['releaseDate'])
358
-
359
- maker.append(result['candidates'][0]['detail']['maker'])
360
-
361
- url.append(result['candidates'][i]['sites'][0]['url'])
362
-
363
- itemName.append(result['candidates'][i]['detail']['itemName'][0:29]) # to restrict length
364
-
365
-
366
-
367
- reply += post_carousel(reply_token,imageUrl,title,brand,releaseDate,maker,url,itemName)
368
-
369
-
370
-
371
- else:
372
-
373
- rep_meg = "お探しのものは見つかりませんでした。"
374
-
375
- reply += reply_text(reply_token, rep_meg)
376
-
377
-
378
-
379
- return HttpResponse(reply) # for test
380
-
381
-
382
-
383
383
  試したこと
384
384
 
385
385
  herokuのログです

6

投稿ミス

2018/10/06 05:47

投稿

senju-jjj
senju-jjj

スコア13

test CHANGED
File without changes
test CHANGED
@@ -1,59 +1,17 @@
1
- ```### 前提・実現したいこと
2
-
3
-
4
-
5
1
  pythonとdjangoでLinebotで作っているのですがメッセージを送っても返信が来ません。
6
2
 
3
+
4
+
7
- ### 発生している問題・エラーメッセージ
5
+ エラーメッセージはありません
6
+
7
+
8
+
8
-
9
+ ```python
10
+
9
-
11
+ コード
10
12
 
11
13
  ```
12
14
 
13
- エラーメッセージ
14
-
15
- エラーメッセージはありません。
16
-
17
- ソースコード```python
18
-
19
-
20
-
21
- コード
22
-
23
- urls.py
24
-
25
- from django.conf.urls import url
26
-
27
-
28
-
29
- from . import views
30
-
31
-
32
-
33
- urlpatterns = [
34
-
35
- url(r'^$', views.index, name="index"),
36
-
37
- url(r'^callback', views.callback),
38
-
39
- ]
40
-
41
-
42
-
43
- '''
44
-
45
- urlpatterns = [
46
-
47
- path('callback/', views.callback),
48
-
49
- path('index/', views.index),
50
-
51
- ]
52
-
53
- '''
54
-
55
- views.py
56
-
57
15
  # -*- encoding: utf-8 -*-
58
16
 
59
17
  import json
@@ -420,13 +378,9 @@
420
378
 
421
379
  return HttpResponse(reply) # for test
422
380
 
423
- '''
381
+
424
-
425
-
426
-
382
+
427
- ### 試したこと
383
+ 試したこと
428
-
429
-
430
384
 
431
385
  herokuのログです
432
386
 
@@ -453,13 +407,3 @@
453
407
  2018-10-06T04:58:04.072054+00:00 heroku[router]: at=info method=POST path="/bot/" host=infinite-oasis-41928.herokuapp.com request_id=d2e3852c-b9c4-4b35-a73e-96f8eec347f3 fwd="203.104.146.156" dyno=web.1 connect=1ms service=2ms status=200 bytes=205 protocol=https
454
408
 
455
409
  2018-10-06T04:58:04.071313+00:00 app[web.1]: 10.11.176.130 - - [06/Oct/2018:04:58:04 +0000] "POST /bot/ HTTP/1.1" 200 16 "-" "LineBotWebhook/1.0"
456
-
457
- ここに問題に対して試したことを記載してください。
458
-
459
-
460
-
461
- ### 補足情報(FW/ツールのバージョンなど)
462
-
463
-
464
-
465
- ここにより詳細な情報を記載してください。

5

a

2018/10/06 05:46

投稿

senju-jjj
senju-jjj

スコア13

test CHANGED
File without changes
test CHANGED
@@ -1,4 +1,4 @@
1
- ### 前提・実現したいこと
1
+ ```### 前提・実現したいこと
2
2
 
3
3
 
4
4
 
@@ -14,9 +14,9 @@
14
14
 
15
15
  エラーメッセージはありません。
16
16
 
17
- ソースコード
18
-
19
- ```python
17
+ ソースコード```python
18
+
19
+
20
20
 
21
21
  コード
22
22
 

4

a

2018/10/06 05:37

投稿

senju-jjj
senju-jjj

スコア13

test CHANGED
File without changes
test CHANGED
@@ -14,11 +14,11 @@
14
14
 
15
15
  エラーメッセージはありません。
16
16
 
17
- ```pyhton
18
-
19
17
  ソースコード
20
18
 
21
- ```
19
+ ```python
20
+
21
+ コード
22
22
 
23
23
  urls.py
24
24
 

3

a

2018/10/06 05:35

投稿

senju-jjj
senju-jjj

スコア13

test CHANGED
File without changes
test CHANGED
@@ -14,422 +14,414 @@
14
14
 
15
15
  エラーメッセージはありません。
16
16
 
17
-
17
+ ```pyhton
18
-
18
+
19
- ### 該当のソースコード
19
+ ソースコード
20
+
20
-
21
+ ```
22
+
23
+ urls.py
24
+
25
+ from django.conf.urls import url
26
+
27
+
28
+
29
+ from . import views
30
+
31
+
32
+
21
- <code>
33
+ urlpatterns = [
34
+
35
+ url(r'^$', views.index, name="index"),
36
+
37
+ url(r'^callback', views.callback),
38
+
39
+ ]
40
+
41
+
22
42
 
23
43
  '''
24
44
 
25
- ```pyhton
26
-
27
- ソースコード
28
-
29
- ```
30
-
31
- urls.py
32
-
33
- from django.conf.urls import url
34
-
35
-
36
-
37
- from . import views
38
-
39
-
40
-
41
45
  urlpatterns = [
42
46
 
43
- url(r'^$', views.index, name="index"),
44
-
45
- url(r'^callback', views.callback),
47
+ path('callback/', views.callback),
48
+
49
+ path('index/', views.index),
46
50
 
47
51
  ]
48
52
 
49
-
50
-
51
53
  '''
52
54
 
53
- urlpatterns = [
54
-
55
- path('callback/', views.callback),
56
-
57
- path('index/', views.index),
58
-
59
- ]
55
+ views.py
56
+
57
+ # -*- encoding: utf-8 -*-
58
+
59
+ import json
60
+
61
+ import requests
62
+
63
+ import sys
64
+
65
+ import pya3rt
66
+
67
+ from django.http import HttpResponse
68
+
69
+ from linebot import LineBotApi
70
+
71
+ from PIL import Image
72
+
73
+ from io import BytesIO
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+ sys.path.append('./bot')
82
+
83
+
84
+
85
+ REPLY_ENDPOINT = 'https://api.line.me/v2/bot/message/reply'
86
+
87
+ ACCESS_TOKEN = ''
88
+
89
+ HEADER = {
90
+
91
+ "Content-Type": "application/json",
92
+
93
+ "Authorization": "Bearer " + ACCESS_TOKEN
94
+
95
+ }
96
+
97
+ lINE_BOT_API = LineBotApi(ACCESS_TOKEN)
98
+
99
+
100
+
101
+ # recuitAPI
102
+
103
+ recuitapikey = ""
104
+
105
+ client = pya3rt.TalkClient(recuitapikey)
106
+
107
+
108
+
109
+ # docomoAPI
110
+
111
+ docomoapikey = ''
112
+
113
+
114
+
115
+ print ('test2')
116
+
117
+
118
+
119
+ # Get API_Path
120
+
121
+ def __build_url(name, version='v1'):
122
+
123
+ return __api_path.format({'version': version, 'name': name})
124
+
125
+
126
+
127
+ __api_path = 'https://api.apigw.smt.docomo.ne.jp/imageRecognition/{0[version]}/{0[name]}'
128
+
129
+
130
+
131
+
132
+
133
+ def index(request):
134
+
135
+ return HttpResponse("This is bot api.")
136
+
137
+
138
+
139
+ # Reply text
140
+
141
+ def reply_text(reply_token, rep_meg):
142
+
143
+ payload = {
144
+
145
+ "replyToken": reply_token,
146
+
147
+ "messages": [
148
+
149
+ {
150
+
151
+ "type": "text",
152
+
153
+ "text": rep_meg
154
+
155
+ }
156
+
157
+ ]
158
+
159
+ }
160
+
161
+
162
+
163
+ print ('test3')
164
+
165
+
166
+
167
+ requests.post(REPLY_ENDPOINT, headers=HEADER, data=json.dumps(payload)) # to send data to LINE
168
+
169
+ return rep_meg
170
+
171
+
172
+
173
+
174
+
175
+ # Save image
176
+
177
+ def save_image(messegeid):
178
+
179
+ message_content = lINE_BOT_API.get_message_content(messegeid)
180
+
181
+
182
+
183
+ i = Image.open(BytesIO(message_content.content))
184
+
185
+ filename = '/tmp/' + messegeid + '.jpg'
186
+
187
+ i.save(filename)
188
+
189
+
190
+
191
+ return filename
192
+
193
+
194
+
195
+ # Get json
196
+
197
+ def get_json(filename):
198
+
199
+ with open(filename, mode='rb') as f:
200
+
201
+ result = requests.post(
202
+
203
+ url=__build_url('recognize'),
204
+
205
+ params={'APIKEY': docomoapikey, 'recog': 'product-all', 'numOfCandidates': 5},
206
+
207
+ data=f,
208
+
209
+ headers={'Content-Type': 'application/octet-stream'})
210
+
211
+ result.raise_for_status()
212
+
213
+ result = result.json()
214
+
215
+ return result
216
+
217
+
218
+
219
+ # Reply carousel
220
+
221
+ def post_carousel(reply_token,imageUrl,title,brand,releaseDate,maker,url,itmeName):
222
+
223
+ payload = {
224
+
225
+ "replyToken":reply_token,
226
+
227
+ "messages":[
228
+
229
+ {
230
+
231
+ "type": "template",
232
+
233
+ "altText": "商品結果",
234
+
235
+ "template": {
236
+
237
+ "type": "carousel",
238
+
239
+ "columns": [
240
+
241
+
242
+
243
+ {
244
+
245
+ "thumbnailImageUrl": imageUrl[0],
246
+
247
+ "title": itmeName[0],
248
+
249
+ "text": "ブランド名:" + brand[0] + " メーカー名:"+ maker[0] +" 発売日:" +releaseDate[0],
250
+
251
+ "actions": [
252
+
253
+
254
+
255
+ {
256
+
257
+ "type": "uri",
258
+
259
+ "label": "Amazonで見る",
260
+
261
+ "uri": url[0]
262
+
263
+ }
264
+
265
+ ]
266
+
267
+ },
268
+
269
+ {
270
+
271
+ "thumbnailImageUrl": imageUrl[1],
272
+
273
+ "title": itmeName[1],
274
+
275
+ "text": "ブランド名:" + brand[1] + " メーカー名:"+ maker[1] +" 発売日:" +releaseDate[1],
276
+
277
+ "actions": [
278
+
279
+
280
+
281
+ {
282
+
283
+ "type": "uri",
284
+
285
+ "label": "Amazonで見る",
286
+
287
+ "uri": url[1]
288
+
289
+ }
290
+
291
+ ]
292
+
293
+ },
294
+
295
+ {
296
+
297
+ "thumbnailImageUrl": imageUrl[2],
298
+
299
+ "title": itmeName[2],
300
+
301
+ "text": "ブランド名:" + brand[2] + " メーカー名:"+ maker[2] +" 発売日:" +releaseDate[2],
302
+
303
+ "actions": [
304
+
305
+
306
+
307
+ {
308
+
309
+ "type": "uri",
310
+
311
+ "label": "Amazonで見る",
312
+
313
+ "uri": url[2]
314
+
315
+ }
316
+
317
+ ]
318
+
319
+ }
320
+
321
+ ]
322
+
323
+ }
324
+
325
+ }
326
+
327
+ ]
328
+
329
+ }
330
+
331
+ req = requests.post(REPLY_ENDPOINT, headers=HEADER, data=json.dumps(payload))
332
+
333
+ return title[0]
334
+
335
+
336
+
337
+
338
+
339
+ def callback(request):
340
+
341
+ reply = ""
342
+
343
+ request_json = json.loads(request.body.decode('utf-8')) # to get json
344
+
345
+
346
+
347
+ print ('test1')
348
+
349
+
350
+
351
+ for e in request_json['events']:
352
+
353
+ reply_token = e['replyToken'] # to get reply_token
354
+
355
+ message_type = e['message']['type'] # to get type
356
+
357
+
358
+
359
+ # reply for test
360
+
361
+ if message_type == 'text':
362
+
363
+
364
+
365
+ text = e['message']['text'] # to get message
366
+
367
+ rep_meg = client.talk(text)["results"][0]["reply"] # to get reply message by recuitTalk
368
+
369
+ reply += reply_text(reply_token, rep_meg)
370
+
371
+
372
+
373
+ # reply for image
374
+
375
+ if message_type == 'image':
376
+
377
+ messegeid = e['message']['id'] # to get messageID
378
+
379
+ filename = save_image(messegeid)
380
+
381
+ result = get_json(filename)
382
+
383
+
384
+
385
+ if (result.get('candidates') != None):
386
+
387
+ imageUrl,title,brand,releaseDate,maker,url,itemName =[],[],[],[],[],[],[]
388
+
389
+
390
+
391
+ for i in range(0,3): # to get item info
392
+
393
+ imageUrl.append(result['candidates'][i]['imageUrl'])
394
+
395
+ title.append(result['candidates'][i]['sites'][0]['title'])
396
+
397
+ brand.append(result['candidates'][i]['detail']['brand'])
398
+
399
+ releaseDate.append(result['candidates'][i]['detail']['releaseDate'])
400
+
401
+ maker.append(result['candidates'][0]['detail']['maker'])
402
+
403
+ url.append(result['candidates'][i]['sites'][0]['url'])
404
+
405
+ itemName.append(result['candidates'][i]['detail']['itemName'][0:29]) # to restrict length
406
+
407
+
408
+
409
+ reply += post_carousel(reply_token,imageUrl,title,brand,releaseDate,maker,url,itemName)
410
+
411
+
412
+
413
+ else:
414
+
415
+ rep_meg = "お探しのものは見つかりませんでした。"
416
+
417
+ reply += reply_text(reply_token, rep_meg)
418
+
419
+
420
+
421
+ return HttpResponse(reply) # for test
60
422
 
61
423
  '''
62
424
 
63
- views.py
64
-
65
- # -*- encoding: utf-8 -*-
66
-
67
- import json
68
-
69
- import requests
70
-
71
- import sys
72
-
73
- import pya3rt
74
-
75
- from django.http import HttpResponse
76
-
77
- from linebot import LineBotApi
78
-
79
- from PIL import Image
80
-
81
- from io import BytesIO
82
-
83
-
84
-
85
-
86
-
87
-
88
-
89
- sys.path.append('./bot')
90
-
91
-
92
-
93
- REPLY_ENDPOINT = 'https://api.line.me/v2/bot/message/reply'
94
-
95
- ACCESS_TOKEN = ''
96
-
97
- HEADER = {
98
-
99
- "Content-Type": "application/json",
100
-
101
- "Authorization": "Bearer " + ACCESS_TOKEN
102
-
103
- }
104
-
105
- lINE_BOT_API = LineBotApi(ACCESS_TOKEN)
106
-
107
-
108
-
109
- # recuitAPI
110
-
111
- recuitapikey = ""
112
-
113
- client = pya3rt.TalkClient(recuitapikey)
114
-
115
-
116
-
117
- # docomoAPI
118
-
119
- docomoapikey = ''
120
-
121
-
122
-
123
- print ('test2')
124
-
125
-
126
-
127
- # Get API_Path
128
-
129
- def __build_url(name, version='v1'):
130
-
131
- return __api_path.format({'version': version, 'name': name})
132
-
133
-
134
-
135
- __api_path = 'https://api.apigw.smt.docomo.ne.jp/imageRecognition/{0[version]}/{0[name]}'
136
-
137
-
138
-
139
-
140
-
141
- def index(request):
142
-
143
- return HttpResponse("This is bot api.")
144
-
145
-
146
-
147
- # Reply text
148
-
149
- def reply_text(reply_token, rep_meg):
150
-
151
- payload = {
152
-
153
- "replyToken": reply_token,
154
-
155
- "messages": [
156
-
157
- {
158
-
159
- "type": "text",
160
-
161
- "text": rep_meg
162
-
163
- }
164
-
165
- ]
166
-
167
- }
168
-
169
-
170
-
171
- print ('test3')
172
-
173
-
174
-
175
- requests.post(REPLY_ENDPOINT, headers=HEADER, data=json.dumps(payload)) # to send data to LINE
176
-
177
- return rep_meg
178
-
179
-
180
-
181
-
182
-
183
- # Save image
184
-
185
- def save_image(messegeid):
186
-
187
- message_content = lINE_BOT_API.get_message_content(messegeid)
188
-
189
-
190
-
191
- i = Image.open(BytesIO(message_content.content))
192
-
193
- filename = '/tmp/' + messegeid + '.jpg'
194
-
195
- i.save(filename)
196
-
197
-
198
-
199
- return filename
200
-
201
-
202
-
203
- # Get json
204
-
205
- def get_json(filename):
206
-
207
- with open(filename, mode='rb') as f:
208
-
209
- result = requests.post(
210
-
211
- url=__build_url('recognize'),
212
-
213
- params={'APIKEY': docomoapikey, 'recog': 'product-all', 'numOfCandidates': 5},
214
-
215
- data=f,
216
-
217
- headers={'Content-Type': 'application/octet-stream'})
218
-
219
- result.raise_for_status()
220
-
221
- result = result.json()
222
-
223
- return result
224
-
225
-
226
-
227
- # Reply carousel
228
-
229
- def post_carousel(reply_token,imageUrl,title,brand,releaseDate,maker,url,itmeName):
230
-
231
- payload = {
232
-
233
- "replyToken":reply_token,
234
-
235
- "messages":[
236
-
237
- {
238
-
239
- "type": "template",
240
-
241
- "altText": "商品結果",
242
-
243
- "template": {
244
-
245
- "type": "carousel",
246
-
247
- "columns": [
248
-
249
-
250
-
251
- {
252
-
253
- "thumbnailImageUrl": imageUrl[0],
254
-
255
- "title": itmeName[0],
256
-
257
- "text": "ブランド名:" + brand[0] + " メーカー名:"+ maker[0] +" 発売日:" +releaseDate[0],
258
-
259
- "actions": [
260
-
261
-
262
-
263
- {
264
-
265
- "type": "uri",
266
-
267
- "label": "Amazonで見る",
268
-
269
- "uri": url[0]
270
-
271
- }
272
-
273
- ]
274
-
275
- },
276
-
277
- {
278
-
279
- "thumbnailImageUrl": imageUrl[1],
280
-
281
- "title": itmeName[1],
282
-
283
- "text": "ブランド名:" + brand[1] + " メーカー名:"+ maker[1] +" 発売日:" +releaseDate[1],
284
-
285
- "actions": [
286
-
287
-
288
-
289
- {
290
-
291
- "type": "uri",
292
-
293
- "label": "Amazonで見る",
294
-
295
- "uri": url[1]
296
-
297
- }
298
-
299
- ]
300
-
301
- },
302
-
303
- {
304
-
305
- "thumbnailImageUrl": imageUrl[2],
306
-
307
- "title": itmeName[2],
308
-
309
- "text": "ブランド名:" + brand[2] + " メーカー名:"+ maker[2] +" 発売日:" +releaseDate[2],
310
-
311
- "actions": [
312
-
313
-
314
-
315
- {
316
-
317
- "type": "uri",
318
-
319
- "label": "Amazonで見る",
320
-
321
- "uri": url[2]
322
-
323
- }
324
-
325
- ]
326
-
327
- }
328
-
329
- ]
330
-
331
- }
332
-
333
- }
334
-
335
- ]
336
-
337
- }
338
-
339
- req = requests.post(REPLY_ENDPOINT, headers=HEADER, data=json.dumps(payload))
340
-
341
- return title[0]
342
-
343
-
344
-
345
-
346
-
347
- def callback(request):
348
-
349
- reply = ""
350
-
351
- request_json = json.loads(request.body.decode('utf-8')) # to get json
352
-
353
-
354
-
355
- print ('test1')
356
-
357
-
358
-
359
- for e in request_json['events']:
360
-
361
- reply_token = e['replyToken'] # to get reply_token
362
-
363
- message_type = e['message']['type'] # to get type
364
-
365
-
366
-
367
- # reply for test
368
-
369
- if message_type == 'text':
370
-
371
-
372
-
373
- text = e['message']['text'] # to get message
374
-
375
- rep_meg = client.talk(text)["results"][0]["reply"] # to get reply message by recuitTalk
376
-
377
- reply += reply_text(reply_token, rep_meg)
378
-
379
-
380
-
381
- # reply for image
382
-
383
- if message_type == 'image':
384
-
385
- messegeid = e['message']['id'] # to get messageID
386
-
387
- filename = save_image(messegeid)
388
-
389
- result = get_json(filename)
390
-
391
-
392
-
393
- if (result.get('candidates') != None):
394
-
395
- imageUrl,title,brand,releaseDate,maker,url,itemName =[],[],[],[],[],[],[]
396
-
397
-
398
-
399
- for i in range(0,3): # to get item info
400
-
401
- imageUrl.append(result['candidates'][i]['imageUrl'])
402
-
403
- title.append(result['candidates'][i]['sites'][0]['title'])
404
-
405
- brand.append(result['candidates'][i]['detail']['brand'])
406
-
407
- releaseDate.append(result['candidates'][i]['detail']['releaseDate'])
408
-
409
- maker.append(result['candidates'][0]['detail']['maker'])
410
-
411
- url.append(result['candidates'][i]['sites'][0]['url'])
412
-
413
- itemName.append(result['candidates'][i]['detail']['itemName'][0:29]) # to restrict length
414
-
415
-
416
-
417
- reply += post_carousel(reply_token,imageUrl,title,brand,releaseDate,maker,url,itemName)
418
-
419
-
420
-
421
- else:
422
-
423
- rep_meg = "お探しのものは見つかりませんでした。"
424
-
425
- reply += reply_text(reply_token, rep_meg)
426
-
427
-
428
-
429
- return HttpResponse(reply) # for test
430
-
431
- '''
432
-
433
425
 
434
426
 
435
427
  ### 試したこと

2

hennsyuu

2018/10/06 05:34

投稿

senju-jjj
senju-jjj

スコア13

test CHANGED
File without changes
test CHANGED
@@ -18,7 +18,9 @@
18
18
 
19
19
  ### 該当のソースコード
20
20
 
21
-
21
+ <code>
22
+
23
+ '''
22
24
 
23
25
  ```pyhton
24
26
 
@@ -426,7 +428,7 @@
426
428
 
427
429
  return HttpResponse(reply) # for test
428
430
 
429
-
431
+ '''
430
432
 
431
433
 
432
434
 

1

文字の修正

2018/10/06 05:33

投稿

senju-jjj
senju-jjj

スコア13

test CHANGED
File without changes
test CHANGED
@@ -90,7 +90,7 @@
90
90
 
91
91
  REPLY_ENDPOINT = 'https://api.line.me/v2/bot/message/reply'
92
92
 
93
- ACCESS_TOKEN = 'MYhP0dOMQbOnnTnXUtoGorIB22jEo/vw8bvCodXR+QSRVXOT0IX5bn6de0AxCaE3igcZCjAXl4AwH60QcDbFYjlT9g33kqUyA34mXjITjtQrWIvsoMLk2AjHTXoVmIiRt9yL4KffW0BbNaVoLNhHhQdB04t89/1O/w1cDnyilFU='
93
+ ACCESS_TOKEN = ''
94
94
 
95
95
  HEADER = {
96
96
 
@@ -106,7 +106,7 @@
106
106
 
107
107
  # recuitAPI
108
108
 
109
- recuitapikey = "DZZ0YVyyBjdFbTarIE1SGtlM8XQSX3Dr"
109
+ recuitapikey = ""
110
110
 
111
111
  client = pya3rt.TalkClient(recuitapikey)
112
112
 
@@ -114,7 +114,7 @@
114
114
 
115
115
  # docomoAPI
116
116
 
117
- docomoapikey = '6f64383237754e464474526250304832477368362f7451316936354f4451667a6e4a715534743037306832'
117
+ docomoapikey = ''
118
118
 
119
119
 
120
120