crawling.js
1.12 KB
1
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
const express = require('express');
const router = express.Router();
const uuid = require('uuid'); //uuid 제대로 이해하고 다시 작성하기.
const getvideo = require('../cheerio/video');
//@가수명 으로 입력이 들어왔을 때, 가수명만 받아서
router.post('/textQuery',async(req,res)=>{
const result = req.body.text;
console.log(result.substring(1));
var videoList = getvideo(result.substring(1));
/*
const request = {
session: sessionPath,
queryInput: {
text: {
// The query to send to the dialogflow agent
text: req.body.text,
// The language used by the client (en-US)
languageCode: languageCode,
},
},
};
// Send request and log result
const responses = await sessionClient.detectIntent(request);
console.log('Detected intent');
const result = responses[0].queryResult;
console.log(` Query: ${result.queryText}`);
console.log(` Response: ${result.fulfillmentText}`);
*/
res.send(result)
res.send(videoList);
})
module.exports = router;