Toggle navigation
Toggle navigation
This project
Loading...
Sign in
곽윤철
/
youtube-comment-seperator
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
곽교린
2022-06-03 22:17:08 +0900
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
9c61a48347de654fad3d42ed5ffebfa3e5a710b6
9c61a483
2 parents
e4fd43aa
17b2a785
Merge branch 'hotfix' into develop
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
app.js
app.js
View file @
9c61a48
...
...
@@ -13,6 +13,7 @@ let videoNum = "TpPwI_Lo0YY"; //비디오 주소(예시)
var
videoLang
=
'all'
;
//설정 언어
const
serverIP
=
"http://localhost:3000"
//서버의 주소
var
commentList
=
new
Array
();
var
AllcommentNum
=
0
;
var
commentNum
=
0
;
var
korNum
=
0
;
var
savednpt
=
''
;
...
...
@@ -75,7 +76,7 @@ function showcomment(response, VideoNum){
<br>
<div id="liveAlertPlaceholder"></div>
<a class="btn btn-dark" href="
${
serverIP
}
/search?videourl=
${
VideoNum
}
&nextpage=
${
savednpt
}
&languages=
${
videoLang
}
" role="button">Show more comments</a>
<button type="button" class="btn btn-danger" onclick="alert('Korean Percent:
${
Math
.
floor
((
korNum
/
commentNum
)
*
10000
)
/
100
}
%')">Get Kor Percent</button>
<button type="button" class="btn btn-danger" onclick="alert('Korean Percent:
${
Math
.
floor
((
korNum
/
All
commentNum
)
*
10000
)
/
100
}
%')">Get Kor Percent</button>
<br>
${
commentDisplay
}
</body>
...
...
@@ -110,6 +111,7 @@ function loadcomment(ApiKey, VideoNum, npt, n, res){
}
tempcommentList
.
push
(
tempComment
);
tempListLen
+=
1
;
AllcommentNum
++
;
}
for
(
let
iter
=
0
;
iter
<
tempListLen
;
iter
++
){
let
langPromise
=
tempcommentList
[
iter
].
lang
.
then
(
langData
=>
{
...
...
@@ -118,9 +120,9 @@ function loadcomment(ApiKey, VideoNum, npt, n, res){
templang
=
await
langPromise
;
if
(
videoLang
==
'all'
||
videoLang
==
templang
){
commentList
.
push
(
tempcommentList
[
iter
]);
if
(
templang
==
"ko"
){
korNum
++
;}
commentNum
++
;
}
if
(
templang
==
"ko"
){
korNum
++
;}
}
//console.log(response.data.items[0].snippet.topLevelComment.snippet.textDisplay);
...
...
@@ -194,6 +196,7 @@ var app = http.createServer(function(request,response){ // request는 브라우
commentList
.
splice
(
0
);
commentNum
=
0
;
//코멘트 리스트 초기화
korNum
=
0
;
AllcommentNum
=
0
;
videoNum
=
queryData
.
videourl
;
videoLang
=
queryData
.
languages
;
...
...
Please
register
or
login
to post a comment