Toggle navigation
Toggle navigation
This project
Loading...
Sign in
장재훈
/
TFT_Chat_Bot
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
2
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
장재훈
2020-06-25 23:34:25 +0000
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
959a8d03c3e903ae186a4cdfcac84e76e7f5d4d9
959a8d03
1 parent
28ea7717
Modify main.js
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
server/composition.js
server/main.js
server/composition.js
View file @
959a8d0
...
...
@@ -19,14 +19,14 @@ getHtml()
.
then
(
html
=>
{
let
ulList
=
[];
const
$
=
cheerio
.
load
(
html
.
data
);
const
$bodyList
=
$
(
"div.Comps__CompsContainer
-kqepsu-0
ol"
).
children
(
"li.notExpanded"
);
const
$bodyList
=
$
(
"div.Comps__CompsContainer ol"
).
children
(
"li.notExpanded"
);
//const $bodyList = $("div.ah_list.PM_CL_realtimeKeyword_list_base ul.ah_l").children("li.ah_item");
//log($bodyList);
$bodyList
.
each
(
function
(
i
,
elem
)
{
//console.log($(this));
rank
+=
$
(
this
).
find
(
"div.CompCard__CardLeft
-sc-1hw5aoj-3 div.TierIconTooltip__TierIconBox-sc-1vdglos-2 svg.createSvgIcon__Svg-sc-1l8xi8d-0
title"
).
text
()
+
"\n"
;
rank
+=
$
(
this
).
find
(
"h1.typography__Body2
-sc-1mpsx83-7
"
).
text
()
+
'\n'
;
rank
+=
$
(
this
).
find
(
"div.CompCard__CardLeft
div.TierIconTooltip__TierIconBox svg.createSvgIcon__Svg
title"
).
text
()
+
"\n"
;
rank
+=
$
(
this
).
find
(
"h1.typography__Body2"
).
text
()
+
'\n'
;
// ulList[i] = {
// //title: $(this).find('span.ah_k').text(),
// //url: $(this).find('a.ah_a').attr('href')
...
...
@@ -34,9 +34,8 @@ getHtml()
// };
// console.log(ulList[i].title);
});
})
log
(
rank
);
});
exports
.
compositionFunction
=
function
(
req
,
res
){
const
responseBody
=
{
"version"
:
"2.0"
,
...
...
server/main.js
View file @
959a8d0
...
...
@@ -7,7 +7,7 @@ const champion = require('./champion.js')
const
item
=
require
(
'./item.js'
)
const
trait
=
require
(
'./trait.js'
)
const
galaxy
=
require
(
'./galaxy.js'
)
const
composition
=
require
(
'./composition.js'
)
//
const composition = require('./composition.js')
app
.
use
(
'/static'
,
express
.
static
(
'data/Image data'
));
app
.
use
(
logger
(
'dev'
,
{}));
app
.
use
(
bodyParser
.
json
());
...
...
@@ -21,7 +21,7 @@ apiRouter.post('/completedItem',item.completedItemFunction);
apiRouter
.
post
(
'/consumableItem'
,
item
.
consumableItemFunction
);
apiRouter
.
post
(
'/trait'
,
trait
.
traitFunction
);
apiRouter
.
post
(
'/galaxy'
,
galaxy
.
galaxyFunction
);
apiRouter
.
post
(
'/composition'
,
composition
.
compositionFunction
);
//
apiRouter.post('/composition',composition.compositionFunction);
app
.
listen
(
23023
,
function
()
{
console
.
log
(
'Skill server listening on port 23023!'
);
...
...
Please
register
or
login
to post a comment