이진아

연재완료 연도별 다음 웹툰

......@@ -275,12 +275,49 @@ function getAllToons() {
allWebtoons = allWebtoonList;
};
allWebtoons2 = new Array();
function getAllToons2() {
allWebtoonList2 = new Array();
//연재 완료 연도별 다음 웹툰
var daum = 'http://webtoon.daum.net/data/pc/webtoon/list_finished/?genre_id=&timeStamp=1575275921086';
var site = 'daum';
client.fetch(daum, {}, 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 yyyy = (item.finishDate).substring(0,4)
var webtoon = {
name: item.title,
thum_link: item.pcThumbnailImage.url,
webtoon_link: webtoon_link,
year : yyyy
}
allWebtoonList2.push(webtoon);
});
});
allWebtoons2 = allWebtoonList2;
}
getAllToons();
//처음 한번 수행
setInterval(getAllToons,5*60*1000);
//5분에 한번 수행
getAllToons2();
setInterval(getAllToons2,5*60*1000);
/* GET home page. */
//진아 : list :allWebtoons2 해도 되는지??!!
router.get('/',
function(req,res,next){
if(req.isAuthenticated()){
......@@ -291,6 +328,7 @@ router.get('/',
res.render('index',{
title: "니툰내툰",
list: allWebtoons
list: allWebtoons2
});
}
});
......