Showing
8 changed files
with
33 additions
and
74 deletions
This diff is collapsed. Click to expand it.
... | @@ -14,7 +14,7 @@ var yourtoons=require('./routes/yourtoons'); | ... | @@ -14,7 +14,7 @@ var yourtoons=require('./routes/yourtoons'); |
14 | var passport = require('passport'); | 14 | var passport = require('passport'); |
15 | var setting = require('./routes/setting'); | 15 | var setting = require('./routes/setting'); |
16 | var session = require('express-session'); | 16 | var session = require('express-session'); |
17 | -var toonviewer = require('./routes/toonviewer'); | 17 | + |
18 | 18 | ||
19 | //port | 19 | //port |
20 | passport.serializeUser(function(user, done) { | 20 | passport.serializeUser(function(user, done) { | ... | ... |
1 | var express = require('express'); | 1 | var express = require('express'); |
2 | -var cheerio = require('cheerio'); | ||
3 | -var request = require('request'); | ||
4 | var async = require('async'); | 2 | var async = require('async'); |
5 | var router = express.Router(); | 3 | var router = express.Router(); |
6 | 4 | ||
... | @@ -20,7 +18,6 @@ function getMyToons(id,cb){ | ... | @@ -20,7 +18,6 @@ function getMyToons(id,cb){ |
20 | }); | 18 | }); |
21 | } | 19 | } |
22 | 20 | ||
23 | - | ||
24 | /* GET home page. */ | 21 | /* GET home page. */ |
25 | router.get('/', function(req, res, next) { | 22 | router.get('/', function(req, res, next) { |
26 | if(!req.isAuthenticated()){ | 23 | if(!req.isAuthenticated()){ | ... | ... |
routes/toonviewer.js
deleted
100644 → 0
1 | -var express = require('express'); | ||
2 | -var router = express.Router(); | ||
3 | -var request = require('request'); | ||
4 | -var cheerio = require('cheerio'); | ||
5 | -var async = require('async'); | ||
6 | - | ||
7 | -function getToonImages(toon_index, num, cb){ | ||
8 | - var imageList = []; | ||
9 | - var toonUrl = "http://comic.naver.com/webtoon/detail.nhn?titleId=" + toon_index + "&no=" + num; | ||
10 | - | ||
11 | - request(toonUrl, function(err, res, html){ | ||
12 | - if(!err){ | ||
13 | - var $ = cheerio.load(html); | ||
14 | - var p = Promise.resolve(); | ||
15 | - var eachs = $("div.wt_viewer > img").each(function(index, element) { | ||
16 | - p = p.then(function() { | ||
17 | - var toonHref = $(element).attr('src'); | ||
18 | - imageList.push(toonHref); | ||
19 | - }); | ||
20 | - }); | ||
21 | - p.then(function(){ | ||
22 | - cb(imageList); | ||
23 | - }); | ||
24 | - }else{ | ||
25 | - console.log("웹툰 이미지 못가져왔습니다."); | ||
26 | - } | ||
27 | - }); | ||
28 | -} | ||
29 | - | ||
30 | -router.get('/:toon_index/:num',function(req,res){ | ||
31 | - if(!req.isAuthenticated()){ | ||
32 | - res.redirect('/'); | ||
33 | - return; | ||
34 | - } | ||
35 | - getToonImages(req.params.toon_index, req.params.num, function(imageList){ | ||
36 | - res.render('toonviewer',{ | ||
37 | - title: "zzz", | ||
38 | - images: imageList | ||
39 | - }); | ||
40 | - }); | ||
41 | - | ||
42 | - // }) | ||
43 | -}); | ||
44 | - | ||
45 | -module.exports = router; | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
... | @@ -67,7 +67,17 @@ | ... | @@ -67,7 +67,17 @@ |
67 | <!-- /.navbar-collapse --> | 67 | <!-- /.navbar-collapse --> |
68 | </div> | 68 | </div> |
69 | </nav> | 69 | </nav> |
70 | - | 70 | +<div id="mylist"> |
71 | + <div class="section-title text-center center"> | ||
72 | + <div class="overlay"> | ||
73 | + <h2>내툰</h2> | ||
74 | + <hr> | ||
75 | + <p>웹툰 담기를 통해 담은 웹툰들의 리스트입니다</p> | ||
76 | + </div> | ||
77 | + </div> | ||
78 | + <div class="container"> | ||
79 | + <div class="row"> | ||
80 | + <div class="categories"> | ||
71 | <table> | 81 | <table> |
72 | <tr> | 82 | <tr> |
73 | <th>썸네일</th> | 83 | <th>썸네일</th> |
... | @@ -168,8 +178,10 @@ | ... | @@ -168,8 +178,10 @@ |
168 | </table> | 178 | </table> |
169 | 179 | ||
170 | </br> | 180 | </br> |
171 | - | 181 | + </div> |
172 | - | 182 | + </div> |
183 | + </div> | ||
184 | +</div> | ||
173 | </body> | 185 | </body> |
174 | 186 | ||
175 | </html> | 187 | </html> | ... | ... |
views/toonviewer.ejs
deleted
100644 → 0
1 | -<!DOCTYPE html> | ||
2 | -<html lang="en"> | ||
3 | -<head> | ||
4 | - <meta charset="UTF-8"> | ||
5 | - <title><%= title %></title> | ||
6 | -</head> | ||
7 | -<body> | ||
8 | -<% | ||
9 | -for(image in images){ | ||
10 | -%> | ||
11 | -<img src="<%= images[image] %>" alt=""/> | ||
12 | -<% | ||
13 | -} | ||
14 | - %> | ||
15 | - | ||
16 | -</body> | ||
17 | -</html> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
... | @@ -58,7 +58,7 @@ | ... | @@ -58,7 +58,7 @@ |
58 | <!-- Collect the nav links, forms, and other content for toggling --> | 58 | <!-- Collect the nav links, forms, and other content for toggling --> |
59 | <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> | 59 | <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> |
60 | <ul class="nav navbar-nav navbar-right"> | 60 | <ul class="nav navbar-nav navbar-right"> |
61 | - <li><a href="#mylist" class="page-scroll">OtherList</a></li> | 61 | + <li><a href="#otherlist" class="page-scroll">OtherList</a></li> |
62 | <li><a href="/mytoons" class="page-scroll">MyList</a></li> | 62 | <li><a href="/mytoons" class="page-scroll">MyList</a></li> |
63 | <li><a href="/auth/logout/kakao" class="page-scroll">Logout</a></li> | 63 | <li><a href="/auth/logout/kakao" class="page-scroll">Logout</a></li> |
64 | </ul> | 64 | </ul> |
... | @@ -66,9 +66,21 @@ | ... | @@ -66,9 +66,21 @@ |
66 | <!-- /.navbar-collapse --> | 66 | <!-- /.navbar-collapse --> |
67 | </div> | 67 | </div> |
68 | </nav> | 68 | </nav> |
69 | +<div id="otherlist"> | ||
70 | + <div class="section-title text-center center"> | ||
71 | + <div class="overlay"> | ||
72 | + <h2>니툰</h2> | ||
73 | + <hr> | ||
74 | + <p>다른 사용자들의 내툰 리스트입니다</p> | ||
75 | + </div> | ||
76 | + </div> | ||
77 | + <div class="container"> | ||
78 | + <div class="row"> | ||
79 | + <div class="categories"> | ||
69 | 80 | ||
70 | <table> | 81 | <table> |
71 | <tr> | 82 | <tr> |
83 | + <th>KakaoID</th> | ||
72 | <th>썸네일</th> | 84 | <th>썸네일</th> |
73 | <th>웹툰명</th> | 85 | <th>웹툰명</th> |
74 | <th>요일</th> | 86 | <th>요일</th> |
... | @@ -97,8 +109,10 @@ | ... | @@ -97,8 +109,10 @@ |
97 | </table> | 109 | </table> |
98 | 110 | ||
99 | </br> | 111 | </br> |
100 | - | 112 | + </div> |
101 | - | 113 | + </div> |
114 | + </div> | ||
115 | +</div> | ||
102 | </body> | 116 | </body> |
103 | 117 | ||
104 | </html> | 118 | </html> | ... | ... |
-
Please register or login to post a comment