Showing
7 changed files
with
50 additions
and
63 deletions
... | @@ -78,7 +78,7 @@ app.use(express.static(path.join(__dirname, 'public'))); | ... | @@ -78,7 +78,7 @@ app.use(express.static(path.join(__dirname, 'public'))); |
78 | connection = mysql.createConnection({ | 78 | connection = mysql.createConnection({ |
79 | host : 'localhost', | 79 | host : 'localhost', |
80 | user : 'root', | 80 | user : 'root', |
81 | - password : 'asd123', | 81 | + password : 'password', |
82 | port : 3306, | 82 | port : 3306, |
83 | database : 'ytmt' | 83 | database : 'ytmt' |
84 | }); | 84 | }); | ... | ... |
... | @@ -149,9 +149,31 @@ router.get('/auth/logout/google',function (req,res) { | ... | @@ -149,9 +149,31 @@ router.get('/auth/logout/google',function (req,res) { |
149 | }) | 149 | }) |
150 | 150 | ||
151 | // | 151 | // |
152 | -function getLatestToon(titleid, day ,cb) { | 152 | +function gettop(){ |
153 | + var daum = 'http://webtoon.daum.net/data/pc/webtoon/list_daily_ranking/serialized?timeStamp=1559440437553'; | ||
154 | + var site = 'daum'; | ||
155 | + | ||
156 | + client.fetch(daum, {}, function (err, $, res, body){ | ||
157 | + | ||
158 | + var data = JSON.parse(body); | ||
159 | + var list = data['data']; | ||
160 | + | ||
161 | + list.forEach(function(item, idx){ | ||
162 | + var webtoon_link = 'http://webtoon.daum.net/webtoon/view/' + item.nickname.toString(); | ||
163 | + var webtoon = { | ||
164 | + toon_index : item.id, | ||
165 | + name : item.title, | ||
166 | + thum_link : item.pcThumbnailImage.url, | ||
167 | + webtoon_link : webtoon_link, | ||
168 | + week : "TOP-10", | ||
169 | + site : site, | ||
170 | + lates : item.latestWebtoonEpisode.episode | ||
171 | + } | ||
172 | + allWebtoonList.push(webtoon); | ||
173 | + }); | ||
174 | + }); | ||
175 | +}; | ||
153 | 176 | ||
154 | -} | ||
155 | 177 | ||
156 | function getDaumToons(_day){ | 178 | function getDaumToons(_day){ |
157 | // X요일 다음 웹툰 | 179 | // X요일 다음 웹툰 |
... | @@ -175,7 +197,8 @@ function getDaumToons(_day){ | ... | @@ -175,7 +197,8 @@ function getDaumToons(_day){ |
175 | webtoon_link : webtoon_link, | 197 | webtoon_link : webtoon_link, |
176 | week : day_name, | 198 | week : day_name, |
177 | site : site, | 199 | site : site, |
178 | - latest : 0 | 200 | + latest : item.latestWebtoonEpisode.episode, |
201 | + averageScore : item.webtoonServices.averageScore, | ||
179 | }; | 202 | }; |
180 | 203 | ||
181 | allWebtoonList.push(webtoon); | 204 | allWebtoonList.push(webtoon); |
... | @@ -204,7 +227,8 @@ function getNaverToons(){ | ... | @@ -204,7 +227,8 @@ function getNaverToons(){ |
204 | webtoon_link : webtoon_link, | 227 | webtoon_link : webtoon_link, |
205 | week : week, | 228 | week : week, |
206 | site : site, | 229 | site : site, |
207 | - latest : 0 | 230 | + latest : 0, |
231 | + averageScore : 0 | ||
208 | }; | 232 | }; |
209 | allWebtoonList.push(webtoon); | 233 | allWebtoonList.push(webtoon); |
210 | }); | 234 | }); |
... | @@ -212,8 +236,8 @@ function getNaverToons(){ | ... | @@ -212,8 +236,8 @@ function getNaverToons(){ |
212 | p.then(function() { | 236 | p.then(function() { |
213 | i = 0; | 237 | i = 0; |
214 | allWebtoonList.forEach(function (webtoon) { | 238 | allWebtoonList.forEach(function (webtoon) { |
215 | - var sql= "INSERT INTO `toon` (toon_index, name, thum_link, webtoon_link, week, site, latest) VALUES(?) ON DUPLICATE KEY UPDATE latest=latest"; | 239 | + var sql= "INSERT INTO `toon` (toon_index, name, thum_link, webtoon_link, week, site, latest, averageScore) VALUES(?) ON DUPLICATE KEY UPDATE averageScore=averageScore"; |
216 | - var values=[webtoon.toon_index, webtoon.name, webtoon.thum_link, webtoon.webtoon_link,webtoon.week, webtoon.site, webtoon.latest]; | 240 | + var values=[webtoon.toon_index, webtoon.name, webtoon.thum_link, webtoon.webtoon_link,webtoon.week, webtoon.site, webtoon.latest, webtoon.averageScore]; |
217 | 241 | ||
218 | connection.query(sql,[values],function(err,result){ | 242 | connection.query(sql,[values],function(err,result){ |
219 | if (err) { | 243 | if (err) { |
... | @@ -228,6 +252,9 @@ function getNaverToons(){ | ... | @@ -228,6 +252,9 @@ function getNaverToons(){ |
228 | }); | 252 | }); |
229 | } | 253 | } |
230 | 254 | ||
255 | + | ||
256 | + | ||
257 | + | ||
231 | // 구현중 | 258 | // 구현중 |
232 | function getTomicsToons(){ | 259 | function getTomicsToons(){ |
233 | 260 | ||
... | @@ -237,10 +264,12 @@ function getTomicsToons(){ | ... | @@ -237,10 +264,12 @@ function getTomicsToons(){ |
237 | allWebtoons = new Array(); | 264 | allWebtoons = new Array(); |
238 | 265 | ||
239 | // 설명 | 266 | // 설명 |
240 | -function getAllToons() { | 267 | + function getAllToons() { |
241 | 268 | ||
242 | allWebtoonList = new Array(); | 269 | allWebtoonList = new Array(); |
243 | 270 | ||
271 | + | ||
272 | + | ||
244 | //월요일 다음 웹툰 | 273 | //월요일 다음 웹툰 |
245 | getDaumToons('mon'); | 274 | getDaumToons('mon'); |
246 | //화요일 다음 웹툰 | 275 | //화요일 다음 웹툰 |
... | @@ -256,9 +285,9 @@ function getAllToons() { | ... | @@ -256,9 +285,9 @@ function getAllToons() { |
256 | //일요일 다음 웹툰 | 285 | //일요일 다음 웹툰 |
257 | getDaumToons('sun'); | 286 | getDaumToons('sun'); |
258 | //네이버 웹툰 | 287 | //네이버 웹툰 |
288 | + gettop(); | ||
289 | + | ||
259 | getNaverToons(); | 290 | getNaverToons(); |
260 | - //투믹스 웹툰 | ||
261 | - getTomicsToons(); | ||
262 | 291 | ||
263 | allWebtoons = allWebtoonList; | 292 | allWebtoons = allWebtoonList; |
264 | }; | 293 | }; | ... | ... |
... | @@ -117,7 +117,7 @@ | ... | @@ -117,7 +117,7 @@ |
117 | var current = ""; | 117 | var current = ""; |
118 | for(webtoon in list){ | 118 | for(webtoon in list){ |
119 | 119 | ||
120 | - if(current!=list[webtoon].week && list[webtoon].site == 'daum'){ | 120 | + if(current!= list[webtoon].week && list[webtoon].site == 'daum'){ |
121 | if(current!=""){ | 121 | if(current!=""){ |
122 | %> | 122 | %> |
123 | </tr> | 123 | </tr> |
... | @@ -204,53 +204,6 @@ | ... | @@ -204,53 +204,6 @@ |
204 | 204 | ||
205 | </div> | 205 | </div> |
206 | 206 | ||
207 | - | ||
208 | - <font size = 30> | ||
209 | - 투믹스 웹툰 | ||
210 | -</font> | ||
211 | -<a onclick="Naver_webtoons.style.display=(Naver_webtoons.style.display=='none')?'block':'none';" href="javascript:void(0)"> | ||
212 | - <img src ='https://is4-ssl.mzstatic.com/image/thumb/Purple128/v4/d9/c7/99/d9c79934-4e9a-4926-fa53-b4863bae52b4/source/512x512bb.jpg' width="83" height="90"/> | ||
213 | -</a> | ||
214 | -<div id="toomiks" style = "display:none"> | ||
215 | - | ||
216 | - <table> | ||
217 | - <% | ||
218 | - var current = ""; | ||
219 | - for(webtoon in list){ | ||
220 | - | ||
221 | - if(current!=list[webtoon].week && list[webtoon].site == 'toomiks'){ | ||
222 | - if(current!=""){ | ||
223 | - %> | ||
224 | - </tr> | ||
225 | - <% } %> | ||
226 | - <tr> | ||
227 | - <th><%= list[webtoon].week %></th> | ||
228 | - <% } %> | ||
229 | - <% | ||
230 | - if(list[webtoon].site == 'toomiks') | ||
231 | - { | ||
232 | - %> | ||
233 | - <td> | ||
234 | - <a href="<%= list[webtoon].webtoon_link %>"> | ||
235 | - <img alt="img" width="83" height="90" src="<%= list[webtoon].thum_link %>"/> | ||
236 | - </a> | ||
237 | - <%= list[webtoon].name %> | ||
238 | - </td> | ||
239 | - <% | ||
240 | - } | ||
241 | - %> | ||
242 | - | ||
243 | - <% | ||
244 | - if(current!=list[webtoon].week) { | ||
245 | - current = list[webtoon].week; | ||
246 | - %> | ||
247 | - | ||
248 | - <% | ||
249 | - } | ||
250 | - } | ||
251 | - %> | ||
252 | - </tr> | ||
253 | - </table> | ||
254 | </br> | 207 | </br> |
255 | 208 | ||
256 | </div> | 209 | </div> | ... | ... |
... | @@ -3,7 +3,7 @@ | ... | @@ -3,7 +3,7 @@ |
3 | <head> | 3 | <head> |
4 | <title>내툰</title> | 4 | <title>내툰</title> |
5 | <link rel='stylesheet' href='/stylesheets/style2.css' /> | 5 | <link rel='stylesheet' href='/stylesheets/style2.css' /> |
6 | - <<!-- Bootstrap --> | 6 | + <!-- Bootstrap --> |
7 | <link rel="stylesheet" type="text/css" href="/stylesheets/bootstrap.css"> | 7 | <link rel="stylesheet" type="text/css" href="/stylesheets/bootstrap.css"> |
8 | <link rel="stylesheet" type="text/css" href="/stylesheets/font-awesome.css"> | 8 | <link rel="stylesheet" type="text/css" href="/stylesheets/font-awesome.css"> |
9 | 9 | ... | ... |
... | @@ -4,7 +4,7 @@ | ... | @@ -4,7 +4,7 @@ |
4 | <meta charset="UTF-8"> | 4 | <meta charset="UTF-8"> |
5 | <title>웹툰 담기</title> | 5 | <title>웹툰 담기</title> |
6 | <link rel='stylesheet' href='/stylesheets/style2.css' /> | 6 | <link rel='stylesheet' href='/stylesheets/style2.css' /> |
7 | - <<!-- Bootstrap --> | 7 | + <!-- Bootstrap --> |
8 | <link rel="stylesheet" type="text/css" href="/stylesheets/bootstrap.css"> | 8 | <link rel="stylesheet" type="text/css" href="/stylesheets/bootstrap.css"> |
9 | <link rel="stylesheet" type="text/css" href="/stylesheets/font-awesome.css"> | 9 | <link rel="stylesheet" type="text/css" href="/stylesheets/font-awesome.css"> |
10 | 10 | ... | ... |
... | @@ -2,8 +2,8 @@ | ... | @@ -2,8 +2,8 @@ |
2 | <html> | 2 | <html> |
3 | <head> | 3 | <head> |
4 | <title>니툰</title> | 4 | <title>니툰</title> |
5 | - <link rel='stylesheet' href='/stylesheets/style2.css' /> | 5 | + <link rel='stylesheet' href='/stylesheets/style2.css'> |
6 | - <<!-- Bootstrap --> | 6 | + <!-- Bootstrap --> |
7 | <link rel="stylesheet" type="text/css" href="/stylesheets/bootstrap.css"> | 7 | <link rel="stylesheet" type="text/css" href="/stylesheets/bootstrap.css"> |
8 | <link rel="stylesheet" type="text/css" href="/stylesheets/font-awesome.css"> | 8 | <link rel="stylesheet" type="text/css" href="/stylesheets/font-awesome.css"> |
9 | 9 | ||
... | @@ -54,7 +54,8 @@ | ... | @@ -54,7 +54,8 @@ |
54 | <!-- Brand and toggle get grouped for better mobile display --> | 54 | <!-- Brand and toggle get grouped for better mobile display --> |
55 | <div class="navbar-header"> | 55 | <div class="navbar-header"> |
56 | <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> | 56 | <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> |
57 | - <a class="navbar-brand page-scroll" href="#page-top" style="font-family:Gugi">니툰</a> </div> | 57 | + <a class="navbar-brand page-scroll" href="#page-top" style="font-family:Gugi">니툰</a> |
58 | + </div> | ||
58 | <!-- Collect the nav links, forms, and other content for toggling --> | 59 | <!-- Collect the nav links, forms, and other content for toggling --> |
59 | <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> | 60 | <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> |
60 | <ul class="nav navbar-nav navbar-right"> | 61 | <ul class="nav navbar-nav navbar-right"> | ... | ... |
-
Please register or login to post a comment