장재훈

Modify main.js

...@@ -19,14 +19,14 @@ getHtml() ...@@ -19,14 +19,14 @@ getHtml()
19 .then(html => { 19 .then(html => {
20 let ulList = []; 20 let ulList = [];
21 const $ = cheerio.load(html.data); 21 const $ = cheerio.load(html.data);
22 - const $bodyList = $("div.Comps__CompsContainer-kqepsu-0 ol").children("li.notExpanded"); 22 + const $bodyList = $("div.Comps__CompsContainer ol").children("li.notExpanded");
23 //const $bodyList = $("div.ah_list.PM_CL_realtimeKeyword_list_base ul.ah_l").children("li.ah_item"); 23 //const $bodyList = $("div.ah_list.PM_CL_realtimeKeyword_list_base ul.ah_l").children("li.ah_item");
24 //log($bodyList); 24 //log($bodyList);
25 25
26 $bodyList.each(function(i,elem) { 26 $bodyList.each(function(i,elem) {
27 //console.log($(this)); 27 //console.log($(this));
28 - rank += $(this).find("div.CompCard__CardLeft-sc-1hw5aoj-3 div.TierIconTooltip__TierIconBox-sc-1vdglos-2 svg.createSvgIcon__Svg-sc-1l8xi8d-0 title").text() + "\n"; 28 + rank += $(this).find("div.CompCard__CardLeft div.TierIconTooltip__TierIconBox svg.createSvgIcon__Svg title").text() + "\n";
29 - rank += $(this).find("h1.typography__Body2-sc-1mpsx83-7").text() + '\n'; 29 + rank += $(this).find("h1.typography__Body2").text() + '\n';
30 // ulList[i] = { 30 // ulList[i] = {
31 // //title: $(this).find('span.ah_k').text(), 31 // //title: $(this).find('span.ah_k').text(),
32 // //url: $(this).find('a.ah_a').attr('href') 32 // //url: $(this).find('a.ah_a').attr('href')
...@@ -34,9 +34,8 @@ getHtml() ...@@ -34,9 +34,8 @@ getHtml()
34 // }; 34 // };
35 // console.log(ulList[i].title); 35 // console.log(ulList[i].title);
36 }); 36 });
37 - 37 + log(rank);
38 - }) 38 +});
39 -
40 exports.compositionFunction = function(req,res){ 39 exports.compositionFunction = function(req,res){
41 const responseBody = { 40 const responseBody = {
42 "version": "2.0", 41 "version": "2.0",
......
...@@ -7,7 +7,7 @@ const champion = require('./champion.js') ...@@ -7,7 +7,7 @@ const champion = require('./champion.js')
7 const item = require('./item.js') 7 const item = require('./item.js')
8 const trait = require('./trait.js') 8 const trait = require('./trait.js')
9 const galaxy = require('./galaxy.js') 9 const galaxy = require('./galaxy.js')
10 -const composition = require('./composition.js') 10 +//const composition = require('./composition.js')
11 app.use('/static', express.static('data/Image data')); 11 app.use('/static', express.static('data/Image data'));
12 app.use(logger('dev', {})); 12 app.use(logger('dev', {}));
13 app.use(bodyParser.json()); 13 app.use(bodyParser.json());
...@@ -21,7 +21,7 @@ apiRouter.post('/completedItem',item.completedItemFunction); ...@@ -21,7 +21,7 @@ apiRouter.post('/completedItem',item.completedItemFunction);
21 apiRouter.post('/consumableItem',item.consumableItemFunction); 21 apiRouter.post('/consumableItem',item.consumableItemFunction);
22 apiRouter.post('/trait',trait.traitFunction); 22 apiRouter.post('/trait',trait.traitFunction);
23 apiRouter.post('/galaxy',galaxy.galaxyFunction); 23 apiRouter.post('/galaxy',galaxy.galaxyFunction);
24 -apiRouter.post('/composition',composition.compositionFunction); 24 +//apiRouter.post('/composition',composition.compositionFunction);
25 25
26 app.listen(23023, function() { 26 app.listen(23023, function() {
27 console.log('Skill server listening on port 23023!'); 27 console.log('Skill server listening on port 23023!');
......