Toggle navigation
Toggle navigation
This project
Loading...
Sign in
이하영
/
YTMT
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
이진아
2019-12-03 17:11:23 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2e4b42d5993ee43f6308326dedd688f8f7428bf2
2e4b42d5
1 parent
6f307464
네이버 영화-현재 좋아요, 현재 예매, 예정 기대지수, 예정 예매
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
108 additions
and
4 deletions
routes/index.js
routes/index.js
View file @
2e4b42d
...
...
@@ -277,11 +277,10 @@ function getAllToons() {
allWebtoons
=
allWebtoonList
;
};
//---------------------------------------------------------------------------------------------------------------------
allWebtoons2
=
new
Array
();
function
getAllToons2
()
{
allWebtoonList2
=
new
Array
();
//연재 완료 연도별 다음 웹툰
...
...
@@ -307,7 +306,7 @@ function getAllToons2() {
});
allWebtoons2
=
allWebtoonList2
;
}
//---------------------------------------------------------------------------------------------------------------------
allWebtoons3
=
new
Array
();
function
getAllToons3
(){
...
...
@@ -671,10 +670,111 @@ function getAllToons3(){
//console.log(allWebtoonList3)
}
},
(
error
)
=>
console
.
log
(
error
));
allWebtoons3
=
allWebtoonList3
;
}
//--------------------------------------------------------------------------------------------------------
allWebtoons4
=
new
Array
();
function
getAllToons4
()
{
allWebtoonList4
=
new
Array
();
//현재 상영작 좋아요 순
const
currentlikemovie
=
'https://movie.naver.com/movie/running/current.nhn?view=list&tab=normal&order=likeCount'
;
axios
.
get
(
currentlikemovie
).
then
(
res
=>
{
if
(
res
.
status
===
200
)
{
let
currentLikeMovie
=
[];
const
$
=
cheerio
.
load
(
res
.
data
);
const
$movieList
=
$
(
'div.lst_wrap ul.lst_detail_t1'
).
children
(
'li'
);
$movieList
.
each
(
function
(
i
)
{
currentLikeMovie
[
i
]
=
{
title
:
$
(
this
).
find
(
'dt.tit a'
).
text
(),
img
:
$
(
this
).
find
(
'div.thumb img'
).
attr
(
'src'
)
//개봉예정작에선 star가 없음
//star: $(this).find('em.num_likeit').text().replace(/\t/gi, '').replace(/\n/gi,'')
};
});
const
data
=
currentLikeMovie
.
filter
(
m
=>
m
.
title
);
allWebtoonList4
.
push
(
data
);
//console.log(data);
}
},
(
error
)
=>
console
.
log
(
error
));
//현재 상영작 예매 순
const
runningreserve
=
'https://movie.naver.com/movie/running/current.nhn?view=list&tab=normal&order=reserve'
;
axios
.
get
(
runningreserve
).
then
(
res
=>
{
if
(
res
.
status
===
200
)
{
let
crawledMovie
=
[];
const
$
=
cheerio
.
load
(
res
.
data
);
const
$movieList
=
$
(
'div.lst_wrap ul.lst_detail_t1'
).
children
(
'li'
);
$movieList
.
each
(
function
(
i
)
{
crawledMovie
[
i
]
=
{
title
:
$
(
this
).
find
(
'dt.tit a'
).
text
(),
img
:
$
(
this
).
find
(
'div.thumb img'
).
attr
(
'src'
)
};
});
const
data
=
crawledMovie
.
filter
(
m
=>
m
.
title
);
allWebtoonList4
.
push
(
data
);
//console.log(data);
}
},
(
error
)
=>
console
.
log
(
error
));
//개봉 예정영화 기대지수순
const
premovieinterest
=
'https://movie.naver.com/movie/running/premovie.nhn?order=interestRate'
;
axios
.
get
(
premovieinterest
).
then
(
res
=>
{
if
(
res
.
status
===
200
)
{
let
crawledMovie
=
[];
const
$
=
cheerio
.
load
(
res
.
data
);
const
$movieList
=
$
(
'div.lst_wrap ul.lst_detail_t1'
).
children
(
'li'
);
$movieList
.
each
(
function
(
i
)
{
crawledMovie
[
i
]
=
{
title
:
$
(
this
).
find
(
'dt.tit a'
).
text
(),
img
:
$
(
this
).
find
(
'div.thumb img'
).
attr
(
'src'
)
};
});
const
data
=
crawledMovie
.
filter
(
m
=>
m
.
title
);
allWebtoonList4
.
push
(
data
);
//console.log(data);
}
},
(
error
)
=>
console
.
log
(
error
));
//계봉 예정영화 예매순
const
prereserve
=
'https://movie.naver.com/movie/running/premovie.nhn?order=reserve'
;
axios
.
get
(
prereserve
).
then
(
res
=>
{
if
(
res
.
status
===
200
)
{
let
crawledMovie
=
[];
const
$
=
cheerio
.
load
(
res
.
data
);
const
$movieList
=
$
(
'div.lst_wrap ul.lst_detail_t1'
).
children
(
'li'
);
$movieList
.
each
(
function
(
i
)
{
crawledMovie
[
i
]
=
{
title
:
$
(
this
).
find
(
'dt.tit a'
).
text
(),
img
:
$
(
this
).
find
(
'div.thumb img'
).
attr
(
'src'
)
};
});
const
data
=
crawledMovie
.
filter
(
m
=>
m
.
title
);
allWebtoonList4
.
push
(
data
);
//console.log(data);
}
},
(
error
)
=>
console
.
log
(
error
));
allWebtoons4
=
allWebtoonList4
;
}
getAllToons
();
//처음 한번 수행
setInterval
(
getAllToons
,
5
*
60
*
1000
);
...
...
@@ -686,6 +786,9 @@ setInterval(getAllToons2,5*60*1000);
getAllToons3
();
setInterval
(
getAllToons3
,
5
*
60
*
1000
);
getAllToons4
();
setInterval
(
getAllToons4
,
5
*
60
*
1000
);
/* GET home page. */
//진아 : list :allWebtoons2.3 해도 되는지??!!
...
...
@@ -701,6 +804,7 @@ router.get('/',
list
:
allWebtoons
list
:
allWebtoons2
list
:
allWebtoons3
list
:
allWebtoons4
});
}
});
...
...
Please
register
or
login
to post a comment