Showing
5 changed files
with
654 additions
and
26 deletions
... | @@ -8,6 +8,7 @@ var mysql = require('mysql'); | ... | @@ -8,6 +8,7 @@ var mysql = require('mysql'); |
8 | var cheerio = require('cheerio'); | 8 | var cheerio = require('cheerio'); |
9 | var request = require('request'); | 9 | var request = require('request'); |
10 | var index = require('./routes/index'); | 10 | var index = require('./routes/index'); |
11 | +var index2 = require('./routes/index2'); | ||
11 | var login = require('./routes/login'); | 12 | var login = require('./routes/login'); |
12 | var users = require('./routes/users'); | 13 | var users = require('./routes/users'); |
13 | var mytoons = require('./routes/mytoons'); | 14 | var mytoons = require('./routes/mytoons'); |
... | @@ -58,6 +59,8 @@ app.use(session({ | ... | @@ -58,6 +59,8 @@ app.use(session({ |
58 | app.use(passport.initialize()); | 59 | app.use(passport.initialize()); |
59 | app.use(passport.session()); | 60 | app.use(passport.session()); |
60 | app.use('/', index); | 61 | app.use('/', index); |
62 | +app.use('/ViewScore', index); | ||
63 | +app.use('/StarScore',index2); | ||
61 | app.use('/login', login); | 64 | app.use('/login', login); |
62 | app.use('/users', users); | 65 | app.use('/users', users); |
63 | app.use('/mytoons', mytoons); | 66 | app.use('/mytoons', mytoons); | ... | ... |
... | @@ -305,7 +305,7 @@ function getAllToons() { | ... | @@ -305,7 +305,7 @@ function getAllToons() { |
305 | }); | 305 | }); |
306 | 306 | ||
307 | //네이버 웹툰 | 307 | //네이버 웹툰 |
308 | - var allWeeklyToonsUrl = "http://comic.naver.com/webtoon/weekday.nhn?order=StarScore"; | 308 | + var allWeeklyToonsUrl = "https://comic.naver.com/webtoon/weekday.nhn"; |
309 | request(allWeeklyToonsUrl,function (err, res, html) { | 309 | request(allWeeklyToonsUrl,function (err, res, html) { |
310 | if(!err){ | 310 | if(!err){ |
311 | var $ = cheerio.load(html); | 311 | var $ = cheerio.load(html); | ... | ... |
routes/index2.js
0 → 100644
1 | +var express = require('express'); | ||
2 | +var cheerio = require('cheerio'); | ||
3 | +var request = require('request'); | ||
4 | +var router = express.Router(); | ||
5 | +var mysql = require('mysql'); | ||
6 | +var client = require('cheerio-httpcli'); | ||
7 | +var passport = require('passport'), | ||
8 | + KakaoStrategy = require('passport-kakao').Strategy, | ||
9 | + naverstrategy = require('passport-naver').Strategy, | ||
10 | + googlestrategy = require('passport-google-oauth20').Strategy; | ||
11 | +const puppeteer = require("puppeteer"); | ||
12 | + | ||
13 | +var connection = mysql.createConnection({ | ||
14 | + host : 'localhost', | ||
15 | + user : 'soap', | ||
16 | + password : '111111', | ||
17 | + port : 3306, | ||
18 | + database : 'ytmt' | ||
19 | +}); | ||
20 | + | ||
21 | +passport.use(new KakaoStrategy({ | ||
22 | + clientID : 'bd2e610396fb7bbb84cf91a786b3cc72', | ||
23 | + callbackURL :'/auth/login/kakao/callback', | ||
24 | + clientSecret : 'eUtJGtlLoCZJufevp3LKfDP0KOtZUV7R' | ||
25 | + }, | ||
26 | + function(accessToken, refreshToken,params, profile, done){ | ||
27 | + //사용자 정보는 profile에 | ||
28 | + loginByThirdparty(accessToken, refreshToken, profile); | ||
29 | + | ||
30 | + console.log("(!)로그인 : " + profile._json.id+"("+profile._json.properties.nickname +")"); | ||
31 | + //return done(null,profile) | ||
32 | + return done(null, { | ||
33 | + 'user_id': profile._json.id, | ||
34 | + 'nickname': profile._json.properties.nickname | ||
35 | + }); | ||
36 | + } | ||
37 | +)); | ||
38 | + | ||
39 | +// kakao 로그인 | ||
40 | +router.get('/auth/login/kakao', | ||
41 | + // passport.authenticate('kakao',{state: "myStateValue"}) | ||
42 | + passport.authenticate('kakao') | ||
43 | +); | ||
44 | + | ||
45 | +// kakao 로그인 연동 콜백 | ||
46 | +router.get('/auth/login/kakao/callback', | ||
47 | + passport.authenticate('kakao', { | ||
48 | + //session: false, | ||
49 | + successRedirect: '/mytoons', | ||
50 | + failureRedirect: '/' | ||
51 | + }) | ||
52 | +); | ||
53 | + | ||
54 | +function loginByThirdparty(accessToken, refreshToken, profile) { | ||
55 | + //예전 코드는 MySQL 버젼이 맞지 않음 | ||
56 | + // var sql = 'INSERT INTO `user`(id) VALUES(?) ON DUPLICATE KEY(PRIMARY) UPDATE id=(?);' | ||
57 | + var sql = "INSERT INTO `user` (id) VALUES (?) ON DUPLICATE KEY UPDATE id=id"; | ||
58 | + var kid=[profile._json.id]; | ||
59 | + connection.query(sql,kid,function(err,result){ | ||
60 | + if (err) { | ||
61 | + console.log("로그인 쿼리중 에러 : " + err); | ||
62 | + } else { | ||
63 | + console.log("로그인 DB처리 완료!"); | ||
64 | + } | ||
65 | + }); | ||
66 | +} | ||
67 | + | ||
68 | +router.get('/auth/logout/kakao',function (req,res) { | ||
69 | + req.logout(); | ||
70 | + res.redirect('/'); | ||
71 | +}) | ||
72 | + | ||
73 | +passport.use(new naverstrategy({ | ||
74 | + clientID : "TfrHnvzNcOTnzT6v6glC", | ||
75 | + clientSecret : "YI1CmmOqTy", | ||
76 | + callbackURL : "/auth/login/naver/callback" | ||
77 | +}, function(accessToken, refreshToken, profile, done) { | ||
78 | + // console.log("Hello world"); | ||
79 | + loginByThirdparty(accessToken, refreshToken, profile); | ||
80 | + | ||
81 | + console.log("(!)로그인 : " + profile._json.id); | ||
82 | + //return done(null,profile) | ||
83 | + return done(null, { | ||
84 | + 'user_id': profile._json.id, | ||
85 | + //'nickname': profile._json.properties.nickname | ||
86 | + }); | ||
87 | +})) | ||
88 | + | ||
89 | +router.get('/auth/login/naver', | ||
90 | + passport.authenticate('naver') | ||
91 | +) | ||
92 | + | ||
93 | +router.get('/auth/login/naver/callback', passport.authenticate('naver', { | ||
94 | + failureRedirect: '/', | ||
95 | + successRedirect: '/mytoons' | ||
96 | +}) | ||
97 | +) | ||
98 | + | ||
99 | + | ||
100 | + | ||
101 | +passport.use(new googlestrategy( { | ||
102 | + clientID : "214039775018-qhv7ha12dd410qfstc4n3nlhbqmblhd2.apps.googleusercontent.com", | ||
103 | + clientSecret: "2DINnGZ--TaTG3bhZfDkAhN0", | ||
104 | + callbackURL : "/auth/login/google/callback" | ||
105 | +}, function (accessToken, refreshToken, profile, done) { | ||
106 | + console.log("Hello world"); | ||
107 | + // User.findOrCreate({ | ||
108 | + // googleId: profile.id | ||
109 | + // }, function (err, user) { | ||
110 | + // return done(err, user); | ||
111 | + // }); | ||
112 | + loginByThirdparty(accessToken, refreshToken, profile); | ||
113 | + | ||
114 | + console.log("(!)로그인 : " + profile._json.id); | ||
115 | + //return done(null,profile) | ||
116 | + return done(null, { | ||
117 | + 'user_id': profile._json.id, | ||
118 | + //'nickname': profile._json.properties.nickname | ||
119 | + }); | ||
120 | +} | ||
121 | +)); | ||
122 | + | ||
123 | +router.get('/auth/login/google', | ||
124 | + passport.authenticate('google',{ | ||
125 | + scope: ['https://www.googleapis.com/auth/plus.login'] | ||
126 | + }) | ||
127 | +); | ||
128 | + | ||
129 | +router.get('/auth/login/google/callback', passport.authenticate('google', { | ||
130 | + failureRedirect: '/', | ||
131 | + successRedirect: '/mytoons' | ||
132 | +})); | ||
133 | + | ||
134 | + | ||
135 | +allWebtoons2 = new Array(); | ||
136 | + | ||
137 | +function getLatestToon(titleid, day ,cb) { | ||
138 | +} | ||
139 | + | ||
140 | +function getAllToons() { | ||
141 | + allWebtoonList2 = new Array(); | ||
142 | +//월요일 다음 웹툰 | ||
143 | + var mon='mon'; | ||
144 | + var mon_name='MON'; | ||
145 | + var daum = `http://webtoon.daum.net/data/pc/webtoon/list_serialized/${mon}?timeStamp=1515819276574`; | ||
146 | + var site = 'daum'; | ||
147 | + client.fetch(daum, {}, function (err, $, res, body) { | ||
148 | + var data = JSON.parse(body); | ||
149 | + var list = data["data"]; | ||
150 | + list.forEach(function (item, idx) { | ||
151 | + var webtoon_link = 'http://webtoon.daum.net/webtoon/view/' + item.nickname.toString(); | ||
152 | + var webtoon = { | ||
153 | + toon_index: item.id, | ||
154 | + name: item.title, | ||
155 | + thum_link: item.pcThumbnailImage.url, | ||
156 | + webtoon_link: webtoon_link, | ||
157 | + week :mon_name, | ||
158 | + site: site, | ||
159 | + latest: 0 | ||
160 | + }; | ||
161 | + allWebtoonList2.push(webtoon); | ||
162 | + }); | ||
163 | + | ||
164 | + }); | ||
165 | + | ||
166 | +//화요일 다음 웹툰 | ||
167 | + var tue='tue'; | ||
168 | + var tue_name='TUE'; | ||
169 | + var daum1 = `http://webtoon.daum.net/data/pc/webtoon/list_serialized/${tue}?timeStamp=1515819276574`; | ||
170 | + client.fetch(daum1, {}, function (err, $, res, body) { | ||
171 | + var data = JSON.parse(body); | ||
172 | + var list = data["data"]; | ||
173 | + list.forEach(function(item, idx){ | ||
174 | + var webtoon_link='http://webtoon.daum.net/webtoon/view/'+item.nickname.toString(); | ||
175 | + var webtoon= { | ||
176 | + toon_index: item.id, | ||
177 | + name : item.title, | ||
178 | + thum_link : item.pcThumbnailImage.url, | ||
179 | + webtoon_link : webtoon_link, | ||
180 | + week : tue_name, | ||
181 | + site : site, | ||
182 | + latest : 0 | ||
183 | + }; | ||
184 | + allWebtoonList2.push(webtoon); | ||
185 | + }); | ||
186 | + | ||
187 | + }); | ||
188 | + | ||
189 | +//수요일 다음 웹툰 | ||
190 | + var wed='wed'; | ||
191 | + var wed_name='WED'; | ||
192 | + var daum2 = `http://webtoon.daum.net/data/pc/webtoon/list_serialized/${wed}?timeStamp=1515819276574`; | ||
193 | + | ||
194 | + client.fetch(daum2, {}, function (err, $, res, body) { | ||
195 | + var data = JSON.parse(body); | ||
196 | + var list = data["data"]; | ||
197 | + | ||
198 | + list.forEach(function(item, idx){ | ||
199 | + | ||
200 | + var webtoon_link='http://webtoon.daum.net/webtoon/view/'+item.nickname.toString(); | ||
201 | + var webtoon= { | ||
202 | + toon_index: item.id, | ||
203 | + name : item.title, | ||
204 | + thum_link : item.pcThumbnailImage.url, | ||
205 | + webtoon_link : webtoon_link, | ||
206 | + week : wed_name, | ||
207 | + site : site, | ||
208 | + latest : 0 | ||
209 | + }; | ||
210 | + allWebtoonList2.push(webtoon); | ||
211 | + }); | ||
212 | + | ||
213 | + }); | ||
214 | + | ||
215 | +//목요일 다음 웹툰 | ||
216 | + var thu='thu'; | ||
217 | + var daum3 =`http://webtoon.daum.net/data/pc/webtoon/list_serialized/${thu}?timeStamp=1515819276574`; | ||
218 | + var thu_name='THU'; | ||
219 | + client.fetch(daum3, {}, function (err, $, res, body) { | ||
220 | + var data = JSON.parse(body); | ||
221 | + var list = data["data"]; | ||
222 | + list.forEach(function(item, idx){ | ||
223 | + var webtoon_link='http://webtoon.daum.net/webtoon/view/'+item.nickname.toString(); | ||
224 | + var webtoon= { | ||
225 | + toon_index: item.id, | ||
226 | + name : item.title, | ||
227 | + thum_link : item.pcThumbnailImage.url, | ||
228 | + webtoon_link : webtoon_link, | ||
229 | + week : thu_name, | ||
230 | + site : site, | ||
231 | + latest : 0 | ||
232 | + }; | ||
233 | + allWebtoonList2.push(webtoon); | ||
234 | + }); | ||
235 | + | ||
236 | + }); | ||
237 | + | ||
238 | +//금요일 다음 웹툰 | ||
239 | + var fri='fri'; | ||
240 | + var daum4 =`http://webtoon.daum.net/data/pc/webtoon/list_serialized/${fri}?timeStamp=1515819276574`; | ||
241 | + var fri_name='FRI'; | ||
242 | + client.fetch(daum4, {}, function (err, $, res, body) { | ||
243 | + var data = JSON.parse(body); | ||
244 | + var list = data["data"]; | ||
245 | + list.forEach(function(item, idx){ | ||
246 | + var webtoon_link='http://webtoon.daum.net/webtoon/view/'+item.nickname.toString(); | ||
247 | + var webtoon= { | ||
248 | + toon_index: item.id, | ||
249 | + name : item.title, | ||
250 | + thum_link : item.pcThumbnailImage.url, | ||
251 | + webtoon_link : webtoon_link, | ||
252 | + week : fri_name, | ||
253 | + site : site, | ||
254 | + latest : 0 | ||
255 | + }; | ||
256 | + allWebtoonList2.push(webtoon); | ||
257 | + }); | ||
258 | + | ||
259 | + }); | ||
260 | + | ||
261 | +//토요일 다음 웹툰 | ||
262 | + var sat='sat'; | ||
263 | + var daum5 =`http://webtoon.daum.net/data/pc/webtoon/list_serialized/${sat}?timeStamp=1515819276574`; | ||
264 | + var sat_name='SAT'; | ||
265 | + client.fetch(daum5, {}, function (err, $, res, body) { | ||
266 | + var data = JSON.parse(body); | ||
267 | + var list = data["data"]; | ||
268 | + list.forEach(function(item, idx){ | ||
269 | + var webtoon_link='http://webtoon.daum.net/webtoon/view/'+item.nickname.toString(); | ||
270 | + var webtoon= { | ||
271 | + toon_index: item.id, | ||
272 | + name : item.title, | ||
273 | + thum_link : item.pcThumbnailImage.url, | ||
274 | + webtoon_link : webtoon_link, | ||
275 | + week : sat_name, | ||
276 | + site : site, | ||
277 | + latest : 0 | ||
278 | + }; | ||
279 | + allWebtoonList2.push(webtoon); | ||
280 | + }); | ||
281 | + | ||
282 | + }); | ||
283 | + | ||
284 | +//일요일 다음 웹툰 | ||
285 | + var sun='sun'; | ||
286 | + var daum6 = `http://webtoon.daum.net/data/pc/webtoon/list_serialized/${sun}?timeStamp=1515819276574`; | ||
287 | + var sun_name='SUN'; | ||
288 | + client.fetch(daum6, {}, function (err, $, res, body) { | ||
289 | + var data = JSON.parse(body); | ||
290 | + var list = data["data"]; | ||
291 | + list.forEach(function(item, idx){ | ||
292 | + //다음 웹툰 아이디, 제목, 요일 | ||
293 | + var webtoon_link='http://webtoon.daum.net/webtoon/view/'+item.nickname.toString(); | ||
294 | + var webtoon= { | ||
295 | + toon_index: item.id, | ||
296 | + name : item.title, | ||
297 | + thum_link : item.pcThumbnailImage.url, | ||
298 | + webtoon_link : webtoon_link, | ||
299 | + week : sun_name, | ||
300 | + site : site, | ||
301 | + latest : 0 | ||
302 | + }; | ||
303 | + allWebtoonList2.push(webtoon); | ||
304 | + }); | ||
305 | + }); | ||
306 | + | ||
307 | +//네이버 웹툰 | ||
308 | + | ||
309 | + var allWeeklyToonsUrl = "https://comic.naver.com/webtoon/weekday.nhn?order=StarScore"; | ||
310 | + request(allWeeklyToonsUrl,function (err, res, html) { | ||
311 | + if(!err){ | ||
312 | + var $ = cheerio.load(html); | ||
313 | + var p = Promise.resolve(); | ||
314 | + var eachs = $(".thumb").each(function (i) { | ||
315 | + var week = $(this).parent().parent().prev().attr('class'); | ||
316 | + var webtoon_link = "http://comic.naver.com" + $(this).children().first().attr('href'); | ||
317 | + var thumb_link = $(this).children().first().children().first().attr('src'); | ||
318 | + var name = $(this).next().text(); | ||
319 | + var titleid = webtoon_link.split('?')[1].split('&')[0].split('=')[1]; | ||
320 | + var site = 'naver'; | ||
321 | + var webtoon= { | ||
322 | + toon_index: titleid, | ||
323 | + name : name, | ||
324 | + thum_link : thumb_link, | ||
325 | + webtoon_link : webtoon_link, | ||
326 | + week : week, | ||
327 | + site : site, | ||
328 | + latest : 0 | ||
329 | + }; | ||
330 | + allWebtoonList2.push(webtoon); | ||
331 | + }); | ||
332 | + p.then(function() { | ||
333 | + i = 0; | ||
334 | + allWebtoonList2.forEach(function (webtoon) { | ||
335 | + var sql= "INSERT INTO `toon` (toon_index, name, thum_link, webtoon_link, week, site, latest) VALUES(?) ON DUPLICATE KEY UPDATE latest=latest"; | ||
336 | + var values=[webtoon.toon_index, webtoon.name, webtoon.thum_link, webtoon.webtoon_link,webtoon.week, webtoon.site, webtoon.latest]; | ||
337 | + connection.query(sql,[values],function(err,result){ | ||
338 | + if (err) { | ||
339 | + console.log("웹툰 DB 에러 : " + err); | ||
340 | + } else { | ||
341 | + // console.log("웹툰 DB처리 완료!"); | ||
342 | + } | ||
343 | + }); | ||
344 | + //}); | ||
345 | + }) | ||
346 | + }); | ||
347 | + } | ||
348 | + }); | ||
349 | + allWebtoons2 = allWebtoonList2; | ||
350 | +}; | ||
351 | + | ||
352 | +popularWWebtoons = new Array(); | ||
353 | +function getPopularToons() { | ||
354 | + var pplWebtoonList = new Array(); | ||
355 | + puppeteer.launch().then(async browser => { | ||
356 | + let page = await browser.newPage(); | ||
357 | + await page.goto("https://comic.naver.com/index.nhn", { waitUntil: "networkidle2" }); | ||
358 | + | ||
359 | + page.waitForNavigation(), // 해당 페이지의 탐색이 완료되면 클릭 이벤트를 실행 | ||
360 | + await page.click("#recommandWebtoonRankWTabOver > a"); // 클릭이벤트를 실행 | ||
361 | + | ||
362 | + let ehList = await page.$$("div.thumb6"); | ||
363 | + for (let eh of ehList) { | ||
364 | + let webtoon_link = await eh.$eval('a', function (el) { | ||
365 | + return el.getAttribute('href'); | ||
366 | + }); | ||
367 | + let thumb_link = await eh.$eval('a img', function (el) { | ||
368 | + return el.getAttribute('src'); | ||
369 | + }); | ||
370 | + let title = await eh.$eval('a', function (el) { | ||
371 | + return el.getAttribute('title'); | ||
372 | + }); | ||
373 | + var pplObj= { | ||
374 | + thumb_link : thumb_link, | ||
375 | + webtoon_link : "http://comic.naver.com" + webtoon_link, | ||
376 | + title : title | ||
377 | + }; | ||
378 | + pplWebtoonList.push(pplObj); | ||
379 | + } | ||
380 | + browser.close(); | ||
381 | + popularWWebtoons = pplWebtoonList; | ||
382 | + }); | ||
383 | + | ||
384 | +} | ||
385 | + | ||
386 | +getAllToons(); | ||
387 | +//처음 한번 수행 | ||
388 | +setInterval(getAllToons,5*60*1000); | ||
389 | +//5분에 한번 수행 | ||
390 | + | ||
391 | +getPopularToons(); | ||
392 | + | ||
393 | +/* GET home page. */ | ||
394 | +router.get('/', | ||
395 | + function(req,res,next){ | ||
396 | + if(req.isAuthenticated()){ | ||
397 | + res.redirect('/mytoons'); | ||
398 | + console.log("(!)이미 로그인"); | ||
399 | + }else{ | ||
400 | + console.log("(!)로그인세션 없음"); | ||
401 | + res.render('index2',{ | ||
402 | + title: "니툰내툰", | ||
403 | + list: allWebtoons2, | ||
404 | + pplWList : popularWWebtoons | ||
405 | + }); | ||
406 | + } | ||
407 | + }); | ||
408 | + | ||
409 | +module.exports = router; |
... | @@ -17,20 +17,6 @@ | ... | @@ -17,20 +17,6 @@ |
17 | <link href="https://fonts.googleapis.com/css?family=Dancing+Script:400,700" rel="stylesheet"> | 17 | <link href="https://fonts.googleapis.com/css?family=Dancing+Script:400,700" rel="stylesheet"> |
18 | <link href="https://fonts.googleapis.com/css?family=Gugi&subset=korean" rel="stylesheet"> | 18 | <link href="https://fonts.googleapis.com/css?family=Gugi&subset=korean" rel="stylesheet"> |
19 | <script src="http://developers.kakao.com/sdk/js/kakao.min.js"> | 19 | <script src="http://developers.kakao.com/sdk/js/kakao.min.js"> |
20 | - function daum_click() | ||
21 | - { | ||
22 | - if(Daum_webtoons.display == "none") | ||
23 | - Daum_webtoons.display == "block"; | ||
24 | - if(Daum_webtoons.display = "block") | ||
25 | - Daum_webtoons.display == "none"; | ||
26 | - } | ||
27 | - function naver_click() | ||
28 | - { | ||
29 | - if(Naver_webtoons.display == "none") | ||
30 | - Naver_webtoons.display == "block"; | ||
31 | - if(Naver_webtoons.display = "block") | ||
32 | - Naver_webtoons.display == "none"; | ||
33 | - } | ||
34 | </script> | 20 | </script> |
35 | </head> | 21 | </head> |
36 | <body id="page-top" data-spy="scroll" data-target=".navbar-fixed-top"> | 22 | <body id="page-top" data-spy="scroll" data-target=".navbar-fixed-top"> |
... | @@ -84,7 +70,7 @@ | ... | @@ -84,7 +70,7 @@ |
84 | <!--수정해주세욤!--> | 70 | <!--수정해주세욤!--> |
85 | <p>마더 프로젝트 니툰내툰(YTMT)를 개선하는 프로젝트입니다. 네이버 웹툰 뿐만 아니라 다음 웹툰도 담을 수 있으며, 타인이 담은 웹툰도 확인할 수 있습니다.</p> | 71 | <p>마더 프로젝트 니툰내툰(YTMT)를 개선하는 프로젝트입니다. 네이버 웹툰 뿐만 아니라 다음 웹툰도 담을 수 있으며, 타인이 담은 웹툰도 확인할 수 있습니다.</p> |
86 | <h3>Programmers</h3> | 72 | <h3>Programmers</h3> |
87 | - <p>2018102184 김진우</p> | 73 | + <p>2017110276 이혜리 | 2018102184 김진우 | 2018102228 정대욱</p> |
88 | </div> | 74 | </div> |
89 | </div> | 75 | </div> |
90 | </div> | 76 | </div> |
... | @@ -154,8 +140,8 @@ | ... | @@ -154,8 +140,8 @@ |
154 | </div> | 140 | </div> |
155 | <!--<br>--> | 141 | <!--<br>--> |
156 | 142 | ||
157 | - <font size = 30> | 143 | + <font size = 10> |
158 | - 네이버 웹툰 | 144 | + 네이버 웹툰 |
159 | </font> | 145 | </font> |
160 | <a onclick="Naver_webtoons.style.display=(Naver_webtoons.style.display=='none') ?'block':'none';" href="javascript:void(0)"> | 146 | <a onclick="Naver_webtoons.style.display=(Naver_webtoons.style.display=='none') ?'block':'none';" href="javascript:void(0)"> |
161 | <img src ='/images/navericon.png' width="83" height="90"/> | 147 | <img src ='/images/navericon.png' width="83" height="90"/> |
... | @@ -187,14 +173,13 @@ | ... | @@ -187,14 +173,13 @@ |
187 | </table> | 173 | </table> |
188 | </div> | 174 | </div> |
189 | 175 | ||
190 | - | 176 | + <br> |
191 | - <a onclick="Naver_webtoons.style.display=(Naver_webtoons.style.display=='none') "> | 177 | + <a href="/ViewScore"> |
192 | - <button>별점순</button> | ||
193 | - </a> | ||
194 | - | ||
195 | - <a onclick="Naver_webtoons.style.display=(Naver_webtoons.style.display=='none') "> | ||
196 | <button>조회순</button> | 178 | <button>조회순</button> |
197 | </a> | 179 | </a> |
180 | + <a href="/StarScore"> | ||
181 | + <button>별점순</button> | ||
182 | + </a> | ||
198 | 183 | ||
199 | 184 | ||
200 | <table> | 185 | <table> |
... | @@ -205,7 +190,6 @@ | ... | @@ -205,7 +190,6 @@ |
205 | if(current!=list[webtoon].week && list[webtoon].site == 'naver'){ | 190 | if(current!=list[webtoon].week && list[webtoon].site == 'naver'){ |
206 | if(current!=""){ | 191 | if(current!=""){ |
207 | %> | 192 | %> |
208 | - </tr> | ||
209 | <% } %> | 193 | <% } %> |
210 | <tr> | 194 | <tr> |
211 | <th><%= list[webtoon].week %></th> | 195 | <th><%= list[webtoon].week %></th> |
... | @@ -218,7 +202,9 @@ | ... | @@ -218,7 +202,9 @@ |
218 | <a href="<%= list[webtoon].webtoon_link %>"> | 202 | <a href="<%= list[webtoon].webtoon_link %>"> |
219 | <img alt="img" width="83" height="90" src="<%= list[webtoon].thum_link %>"/> | 203 | <img alt="img" width="83" height="90" src="<%= list[webtoon].thum_link %>"/> |
220 | </a> | 204 | </a> |
205 | + <a style="color: black"> | ||
221 | <%= list[webtoon].name %> | 206 | <%= list[webtoon].name %> |
207 | + </a> | ||
222 | </td> | 208 | </td> |
223 | <% | 209 | <% |
224 | } | 210 | } |
... | @@ -233,8 +219,8 @@ | ... | @@ -233,8 +219,8 @@ |
233 | } | 219 | } |
234 | } | 220 | } |
235 | %> | 221 | %> |
236 | - | ||
237 | </tr> | 222 | </tr> |
223 | + | ||
238 | </table> | 224 | </table> |
239 | </br> | 225 | </br> |
240 | 226 | ... | ... |
views/index2.ejs
0 → 100644
1 | +<!DOCTYPE html> | ||
2 | +<html> | ||
3 | + <head> | ||
4 | + <title><%= title %></title> | ||
5 | + <link rel='stylesheet' href='/stylesheets/style.css' /> | ||
6 | + <<!-- Bootstrap --> | ||
7 | + <link rel="stylesheet" type="text/css" href="/stylesheets/bootstrap.css"> | ||
8 | + <link rel="stylesheet" type="text/css" href="/stylesheets/font-awesome.css"> | ||
9 | + | ||
10 | + <!-- Stylesheet | ||
11 | + ================================================== --> | ||
12 | + <link rel="stylesheet" type="text/css" href="/stylesheets/style.css"> | ||
13 | + <link rel="stylesheet" type="text/css" href="/stylesheets/nivo-lightbox/nivo-lightbox.css"> | ||
14 | + <link rel="stylesheet" type="text/css" href="/stylesheets/nivo-lightbox/default.css"> | ||
15 | + <link href="https://fonts.googleapis.com/css?family=Raleway:300,400,500,600,700" rel="stylesheet"> | ||
16 | + <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700" rel="stylesheet"> | ||
17 | + <link href="https://fonts.googleapis.com/css?family=Dancing+Script:400,700" rel="stylesheet"> | ||
18 | + <link href="https://fonts.googleapis.com/css?family=Gugi&subset=korean" rel="stylesheet"> | ||
19 | + <script src="http://developers.kakao.com/sdk/js/kakao.min.js"> | ||
20 | + </script> | ||
21 | + </head> | ||
22 | + <body id="page-top" data-spy="scroll" data-target=".navbar-fixed-top"> | ||
23 | + <!-- Navigation | ||
24 | + ==========================================--> | ||
25 | + <nav id="menu" class="navbar navbar-default navbar-fixed-top"> | ||
26 | + <div class="container"> | ||
27 | + <!-- Brand and toggle get grouped for better mobile display --> | ||
28 | + <div class="navbar-header"> | ||
29 | + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> | ||
30 | + <a class="navbar-brand page-scroll" href="#page-top" style="font-family:Gugi">니툰내툰</a> </div> | ||
31 | + <!-- Collect the nav links, forms, and other content for toggling --> | ||
32 | + <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> | ||
33 | + <ul class="nav navbar-nav navbar-right"> | ||
34 | + <li><a href="#about" class="page-scroll">about</a></li> | ||
35 | + <li><a href="#portfolio" class="page-scroll">Webtoos</a></li> | ||
36 | + <li><a href="/login" class="page-scroll">Login</a></li> | ||
37 | + </ul> | ||
38 | + </div> | ||
39 | + <!-- /.navbar-collapse --> | ||
40 | + </div> | ||
41 | + </nav> | ||
42 | + <!-- Header --> | ||
43 | + <header id="header"> | ||
44 | + <div class="intro"> | ||
45 | + <div class="overlay"> | ||
46 | + <div class="container"> | ||
47 | + <div class="row"> | ||
48 | + <div class="intro-text"> | ||
49 | + | ||
50 | + <h1 style="font-family:Gugi">니툰내툰</h1> | ||
51 | + <p>NAVER / DAUM / WEBTOONS</p> | ||
52 | + <a href="#about" class="btn btn-custom btn-lg page-scroll">All the Webtoons</a> </div> | ||
53 | + </div> | ||
54 | + </div> | ||
55 | + </div> | ||
56 | + </div> | ||
57 | + </header> | ||
58 | + | ||
59 | + <!-- About Section --> | ||
60 | + <div id="about"> | ||
61 | + <div class="container"> | ||
62 | + <div class="row"> | ||
63 | + <div class="col-xs-12 col-md-6 "> | ||
64 | + <div class="about-img"><img src="images/toon.png" class="img-responsive" alt=""></div> | ||
65 | + </div> | ||
66 | + <div class="col-xs-12 col-md-6"> | ||
67 | + <div class="about-text"> | ||
68 | + <h2>Our Term-Project</h2> | ||
69 | + <hr> | ||
70 | + <!--수정해주세욤!--> | ||
71 | + <p>마더 프로젝트 니툰내툰(YTMT)를 개선하는 프로젝트입니다. 네이버 웹툰 뿐만 아니라 다음 웹툰도 담을 수 있으며, 타인이 담은 웹툰도 확인할 수 있습니다.</p> | ||
72 | + <h3>Programmers</h3> | ||
73 | + <p>2017110276 이혜리 | 2018102184 김진우 | 2018102228 정대욱</p> | ||
74 | + </div> | ||
75 | + </div> | ||
76 | + </div> | ||
77 | + </div> | ||
78 | + </div> | ||
79 | + <!-- Portfolio Section --> | ||
80 | + <div id="portfolio"> | ||
81 | + <div class="section-title text-center center"> | ||
82 | + <div class="overlay"> | ||
83 | + <h2>Gallery</h2> | ||
84 | + <hr> | ||
85 | + <p>니툰내툰에서 제공하는 웹툰 리스트입니다</p> | ||
86 | + </div> | ||
87 | + </div> | ||
88 | + <div class="container"> | ||
89 | + <div class="row"> | ||
90 | + <div class="categories"> | ||
91 | + <ul class="cat"> | ||
92 | + | ||
93 | + <font size = 30> | ||
94 | + 다음 웹툰 | ||
95 | + </font> | ||
96 | + | ||
97 | + <a onclick="Daum_webtoons.style.display=(Daum_webtoons.style.display=='none')?'block':'none';" href="javascript:void(0)"> | ||
98 | + <img src ='/images/daumicon.png' width="83" height="90" onclick="daum_click" /> | ||
99 | + </a> | ||
100 | + <div style="display:none" id="Daum_webtoons"> | ||
101 | + <table> | ||
102 | + <% | ||
103 | + var current = ""; | ||
104 | + for(webtoon in list){ | ||
105 | + | ||
106 | + if(current!=list[webtoon].week && list[webtoon].site == 'daum'){ | ||
107 | + if(current!=""){ | ||
108 | + %> | ||
109 | + </tr> | ||
110 | + <% } %> | ||
111 | + <tr> | ||
112 | + <th><%= list[webtoon].week %></th> | ||
113 | + <% } %> | ||
114 | + <% | ||
115 | + if(list[webtoon].site == 'daum') | ||
116 | + { | ||
117 | + %> | ||
118 | + <td> | ||
119 | + <a href="<%= list[webtoon].webtoon_link %>"> | ||
120 | + <img alt="img" width="83" height="90" src="<%= list[webtoon].thum_link %>"/> | ||
121 | + </a> | ||
122 | + <%= list[webtoon].name %> | ||
123 | + </td> | ||
124 | + <% | ||
125 | + } | ||
126 | + %> | ||
127 | + | ||
128 | + <% | ||
129 | + if(current!=list[webtoon].week) { | ||
130 | + current = list[webtoon].week; | ||
131 | + %> | ||
132 | + | ||
133 | + <% | ||
134 | + } | ||
135 | + } | ||
136 | + %> | ||
137 | + </tr> | ||
138 | + </table> | ||
139 | + <!--</br>--> | ||
140 | + </div> | ||
141 | + <!--<br>--> | ||
142 | + | ||
143 | + <font size = 10> | ||
144 | + 네이버 웹툰 | ||
145 | + </font> | ||
146 | + <a onclick="Naver_webtoons.style.display=(Naver_webtoons.style.display=='none') ?'block':'none';" href="javascript:void(0)"> | ||
147 | + <img src ='/images/navericon.png' width="83" height="90"/> | ||
148 | + </a> | ||
149 | + | ||
150 | + <div id="Naver_webtoons" style = "display:none"> | ||
151 | + </br> | ||
152 | + <div class="Pupular" style= "border: 1px solid; padding: 12px; width:650px; height:330px; margin:auto;"> | ||
153 | + <table> | ||
154 | + <p>20대 실시간 인기순위</p> | ||
155 | + <tr> | ||
156 | + <th align = "center"> 여자</th> | ||
157 | + </tr> | ||
158 | + <tr> | ||
159 | + <% let i = 1; | ||
160 | + for(toon in pplWList) { | ||
161 | + %> | ||
162 | + | ||
163 | + <th><%= i%></th> | ||
164 | + <th> | ||
165 | + <a href="<%= pplWList[toon].webtoon_link %>"> | ||
166 | + <img alt="img" width="43" height="50" src="<%= pplWList[toon].thumb_link %>" /> | ||
167 | + </a> | ||
168 | + <%= pplWList[toon].title %> | ||
169 | + </th> | ||
170 | + </tr> | ||
171 | + <% i += 1; %> | ||
172 | + <% } %> | ||
173 | + </table> | ||
174 | + </div> | ||
175 | + | ||
176 | + <br> | ||
177 | + <a href="/ViewScore"> | ||
178 | + <button>조회순</button> | ||
179 | + </a> | ||
180 | + <a href="/StarScore"> | ||
181 | + <button>별점순</button> | ||
182 | + </a> | ||
183 | + | ||
184 | + | ||
185 | + <table> | ||
186 | + <% | ||
187 | + var current = ""; | ||
188 | + for(webtoon in list){ | ||
189 | + | ||
190 | + if(current!=list[webtoon].week && list[webtoon].site == 'naver'){ | ||
191 | + if(current!=""){ | ||
192 | + %> | ||
193 | + <% } %> | ||
194 | + <tr> | ||
195 | + <th><%= list[webtoon].week %></th> | ||
196 | + <% } %> | ||
197 | + <% | ||
198 | + if(list[webtoon].site == 'naver') | ||
199 | + { | ||
200 | + %> | ||
201 | + <td> | ||
202 | + <a href="<%= list[webtoon].webtoon_link %>"> | ||
203 | + <img alt="img" width="83" height="90" src="<%= list[webtoon].thum_link %>"/> | ||
204 | + </a> | ||
205 | + <a style="color: black"> | ||
206 | + <%= list[webtoon].name %> | ||
207 | + </a> | ||
208 | + </td> | ||
209 | + <% | ||
210 | + } | ||
211 | + %> | ||
212 | + | ||
213 | + <% | ||
214 | + if(current!=list[webtoon].week) { | ||
215 | + current = list[webtoon].week; | ||
216 | + %> | ||
217 | + | ||
218 | + <% | ||
219 | + } | ||
220 | + } | ||
221 | + %> | ||
222 | + </tr> | ||
223 | + | ||
224 | + </table> | ||
225 | + </br> | ||
226 | + | ||
227 | + </div> | ||
228 | + </body> | ||
229 | + | ||
230 | +</html> |
-
Please register or login to post a comment