Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hyunjong Lee
/
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
hyunjong
2019-05-25 23:03:35 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
73c3d4a8253bc74270bf53844b4dd918f85ddce7
73c3d4a8
1 parent
9f601913
index.js were been clean codes
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
169 deletions
routes/index.js
routes/index.js
View file @
73c3d4a
...
...
@@ -30,7 +30,7 @@ passport.use(new KakaoStrategy({
}
));
// kakao 로그인
, // passport.authenticate('kakao',{state: "myStateValue"})
// kakao 로그인
router
.
get
(
'/auth/login/kakao'
,
passport
.
authenticate
(
'kakao'
));
// kakao 로그인 연동 콜백
...
...
@@ -68,18 +68,11 @@ function getLatestToon(titleid, day ,cb) {
}
// 설명
allWebtoons
=
new
Array
();
// 설명
function
getAllToons
()
{
allWebtoonList
=
new
Array
();
//월요일 다음 웹툰
var
mon
=
'mon'
;
var
mon_name
=
'MON'
;
var
daum
=
`http://webtoon.daum.net/data/pc/webtoon/list_serialized/
${
mon
}
?timeStamp=1515819276574`
;
function
getDaumToons
(
_day
){
// X요일 다음 웹툰
var
day
=
_day
;
var
day_name
=
day
;
var
daum
=
`http://webtoon.daum.net/data/pc/webtoon/list_serialized/
${
day
}
?timeStamp=1515819276574`
;
var
site
=
'daum'
;
client
.
fetch
(
daum
,
{},
function
(
err
,
$
,
res
,
body
)
{
...
...
@@ -91,37 +84,11 @@ function getAllToons() {
var
webtoon_link
=
'http://webtoon.daum.net/webtoon/view/'
+
item
.
nickname
.
toString
();
var
webtoon
=
{
toon_index
:
item
.
id
,
name
:
item
.
title
,
thum_link
:
item
.
pcThumbnailImage
.
url
,
webtoon_link
:
webtoon_link
,
week
:
mon_name
,
site
:
site
,
latest
:
0
};
allWebtoonList
.
push
(
webtoon
);
});
});
//화요일 다음 웹툰
var
tue
=
'tue'
;
var
tue_name
=
'TUE'
;
var
daum1
=
`http://webtoon.daum.net/data/pc/webtoon/list_serialized/
${
tue
}
?timeStamp=1515819276574`
;
client
.
fetch
(
daum1
,
{},
function
(
err
,
$
,
res
,
body
)
{
var
data
=
JSON
.
parse
(
body
);
var
list
=
data
[
"data"
];
list
.
forEach
(
function
(
item
,
idx
){
var
webtoon_link
=
'http://webtoon.daum.net/webtoon/view/'
+
item
.
nickname
.
toString
();
var
webtoon
=
{
toon_index
:
item
.
id
,
toon_index
:
item
.
id
,
name
:
item
.
title
,
thum_link
:
item
.
pcThumbnailImage
.
url
,
webtoon_link
:
webtoon_link
,
week
:
tue
_name
,
week
:
day
_name
,
site
:
site
,
latest
:
0
};
...
...
@@ -129,134 +96,9 @@ function getAllToons() {
allWebtoonList
.
push
(
webtoon
);
});
});
}
//수요일 다음 웹툰
var
wed
=
'wed'
;
var
wed_name
=
'WED'
;
var
daum2
=
`http://webtoon.daum.net/data/pc/webtoon/list_serialized/
${
wed
}
?timeStamp=1515819276574`
;
client
.
fetch
(
daum2
,
{},
function
(
err
,
$
,
res
,
body
)
{
var
data
=
JSON
.
parse
(
body
);
var
list
=
data
[
"data"
];
list
.
forEach
(
function
(
item
,
idx
){
var
webtoon_link
=
'http://webtoon.daum.net/webtoon/view/'
+
item
.
nickname
.
toString
();
var
webtoon
=
{
toon_index
:
item
.
id
,
name
:
item
.
title
,
thum_link
:
item
.
pcThumbnailImage
.
url
,
webtoon_link
:
webtoon_link
,
week
:
wed_name
,
site
:
site
,
latest
:
0
};
allWebtoonList
.
push
(
webtoon
);
});
});
//목요일 다음 웹툰
var
thu
=
'thu'
;
var
daum3
=
`http://webtoon.daum.net/data/pc/webtoon/list_serialized/
${
thu
}
?timeStamp=1515819276574`
;
var
thu_name
=
'THU'
;
client
.
fetch
(
daum3
,
{},
function
(
err
,
$
,
res
,
body
)
{
var
data
=
JSON
.
parse
(
body
);
var
list
=
data
[
"data"
];
list
.
forEach
(
function
(
item
,
idx
){
var
webtoon_link
=
'http://webtoon.daum.net/webtoon/view/'
+
item
.
nickname
.
toString
();
var
webtoon
=
{
toon_index
:
item
.
id
,
name
:
item
.
title
,
thum_link
:
item
.
pcThumbnailImage
.
url
,
webtoon_link
:
webtoon_link
,
week
:
thu_name
,
site
:
site
,
latest
:
0
};
allWebtoonList
.
push
(
webtoon
);
});
});
//금요일 다음 웹툰
var
fri
=
'fri'
;
var
daum4
=
`http://webtoon.daum.net/data/pc/webtoon/list_serialized/
${
fri
}
?timeStamp=1515819276574`
;
var
fri_name
=
'FRI'
;
client
.
fetch
(
daum4
,
{},
function
(
err
,
$
,
res
,
body
)
{
var
data
=
JSON
.
parse
(
body
);
var
list
=
data
[
"data"
];
list
.
forEach
(
function
(
item
,
idx
){
var
webtoon_link
=
'http://webtoon.daum.net/webtoon/view/'
+
item
.
nickname
.
toString
();
var
webtoon
=
{
toon_index
:
item
.
id
,
name
:
item
.
title
,
thum_link
:
item
.
pcThumbnailImage
.
url
,
webtoon_link
:
webtoon_link
,
week
:
fri_name
,
site
:
site
,
latest
:
0
};
allWebtoonList
.
push
(
webtoon
);
});
});
//토요일 다음 웹툰
var
sat
=
'sat'
;
var
daum5
=
`http://webtoon.daum.net/data/pc/webtoon/list_serialized/
${
sat
}
?timeStamp=1515819276574`
;
var
sat_name
=
'SAT'
;
client
.
fetch
(
daum5
,
{},
function
(
err
,
$
,
res
,
body
)
{
var
data
=
JSON
.
parse
(
body
);
var
list
=
data
[
"data"
];
list
.
forEach
(
function
(
item
,
idx
){
var
webtoon_link
=
'http://webtoon.daum.net/webtoon/view/'
+
item
.
nickname
.
toString
();
var
webtoon
=
{
toon_index
:
item
.
id
,
name
:
item
.
title
,
thum_link
:
item
.
pcThumbnailImage
.
url
,
webtoon_link
:
webtoon_link
,
week
:
sat_name
,
site
:
site
,
latest
:
0
};
allWebtoonList
.
push
(
webtoon
);
});
});
//일요일 다음 웹툰
var
sun
=
'sun'
;
var
daum6
=
`http://webtoon.daum.net/data/pc/webtoon/list_serialized/
${
sun
}
?timeStamp=1515819276574`
;
var
sun_name
=
'SUN'
;
client
.
fetch
(
daum6
,
{},
function
(
err
,
$
,
res
,
body
)
{
var
data
=
JSON
.
parse
(
body
);
var
list
=
data
[
"data"
];
list
.
forEach
(
function
(
item
,
idx
){
var
webtoon_link
=
'http://webtoon.daum.net/webtoon/view/'
+
item
.
nickname
.
toString
();
var
webtoon
=
{
toon_index
:
item
.
id
,
name
:
item
.
title
,
thum_link
:
item
.
pcThumbnailImage
.
url
,
webtoon_link
:
webtoon_link
,
week
:
sun_name
,
site
:
site
,
latest
:
0
};
allWebtoonList
.
push
(
webtoon
);
});
});
//네이버 웹툰
function
getNaverToons
(){
var
allWeeklyToonsUrl
=
"http://comic.naver.com/webtoon/weekday.nhn"
;
request
(
allWeeklyToonsUrl
,
function
(
err
,
res
,
html
)
{
if
(
!
err
){
...
...
@@ -298,8 +140,47 @@ function getAllToons() {
});
}
});
}
// 구현중
function
getTomicsToons
(){
}
// 설명
allWebtoons
=
new
Array
();
// 설명
function
getAllToons
()
{
allWebtoonList
=
new
Array
();
//월요일 다음 웹툰
getDaumToons
(
'mon'
);
//화요일 다음 웹툰
getDaumToons
(
'tue'
);
//수요일 다음 웹툰
getDaumToons
(
'wed'
);
//목요일 다음 웹툰
getDaumToons
(
'thu'
);
//금요일 다음 웹툰
getDaumToons
(
'fri'
);
//토요일 다음 웹툰
getDaumToons
(
'sat'
);
//일요일 다음 웹툰
getDaumToons
(
'sun'
);
//네이버 웹툰
getNaverToons
();
//투믹스 웹툰
getTomicsToons
();
allWebtoons
=
allWebtoonList
;
};
...
...
@@ -308,7 +189,7 @@ function getAllToons() {
getAllToons
();
//5분에 한번 수행
setInterval
(
getAllToons
,
5
*
60
*
1000
);
setInterval
(
getAllToons
,
5
*
60
*
1000
);
/* GET home page. */
router
.
get
(
'/'
,
function
(
req
,
res
,
next
)
{
...
...
Please
register
or
login
to post a comment