Akhidjon

Added ranking Top-10

......@@ -78,7 +78,7 @@ app.use(express.static(path.join(__dirname, 'public')));
connection = mysql.createConnection({
host : 'localhost',
user : 'root',
password : 'asd123',
password : 'password',
port : 3306,
database : 'ytmt'
});
......
......@@ -6,3 +6,7 @@ body {
a {
color: #00B7FF;
}
.navbar #mylist .section-title .overlay{
background: blueviolet;
}
\ No newline at end of file
......
......@@ -149,9 +149,31 @@ router.get('/auth/logout/google',function (req,res) {
})
//
function getLatestToon(titleid, day ,cb) {
function gettop(){
var daum = 'http://webtoon.daum.net/data/pc/webtoon/list_daily_ranking/serialized?timeStamp=1559440437553';
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 webtoon = {
toon_index : item.id,
name : item.title,
thum_link : item.pcThumbnailImage.url,
webtoon_link : webtoon_link,
week : "TOP-10",
site : site,
lates : item.latestWebtoonEpisode.episode
}
allWebtoonList.push(webtoon);
});
});
};
}
function getDaumToons(_day){
// X요일 다음 웹툰
......@@ -175,7 +197,8 @@ function getDaumToons(_day){
webtoon_link : webtoon_link,
week : day_name,
site : site,
latest : 0
latest : item.latestWebtoonEpisode.episode,
averageScore : item.webtoonServices.averageScore,
};
allWebtoonList.push(webtoon);
......@@ -204,7 +227,8 @@ function getNaverToons(){
webtoon_link : webtoon_link,
week : week,
site : site,
latest : 0
latest : 0,
averageScore : 0
};
allWebtoonList.push(webtoon);
});
......@@ -212,8 +236,8 @@ function getNaverToons(){
p.then(function() {
i = 0;
allWebtoonList.forEach(function (webtoon) {
var sql= "INSERT INTO `toon` (toon_index, name, thum_link, webtoon_link, week, site, latest) VALUES(?) ON DUPLICATE KEY UPDATE latest=latest";
var values=[webtoon.toon_index, webtoon.name, webtoon.thum_link, webtoon.webtoon_link,webtoon.week, webtoon.site, webtoon.latest];
var sql= "INSERT INTO `toon` (toon_index, name, thum_link, webtoon_link, week, site, latest, averageScore) VALUES(?) ON DUPLICATE KEY UPDATE averageScore=averageScore";
var values=[webtoon.toon_index, webtoon.name, webtoon.thum_link, webtoon.webtoon_link,webtoon.week, webtoon.site, webtoon.latest, webtoon.averageScore];
connection.query(sql,[values],function(err,result){
if (err) {
......@@ -228,6 +252,9 @@ function getNaverToons(){
});
}
// 구현중
function getTomicsToons(){
......@@ -237,10 +264,12 @@ function getTomicsToons(){
allWebtoons = new Array();
// 설명
function getAllToons() {
function getAllToons() {
allWebtoonList = new Array();
//월요일 다음 웹툰
getDaumToons('mon');
//화요일 다음 웹툰
......@@ -256,9 +285,9 @@ function getAllToons() {
//일요일 다음 웹툰
getDaumToons('sun');
//네이버 웹툰
gettop();
getNaverToons();
//투믹스 웹툰
getTomicsToons();
allWebtoons = allWebtoonList;
};
......
......@@ -117,7 +117,7 @@
var current = "";
for(webtoon in list){
if(current!=list[webtoon].week && list[webtoon].site == 'daum'){
if(current!= list[webtoon].week && list[webtoon].site == 'daum'){
if(current!=""){
%>
</tr>
......@@ -204,53 +204,6 @@
</div>
<font size = 30>
투믹스 웹툰
</font>
<a onclick="Naver_webtoons.style.display=(Naver_webtoons.style.display=='none')?'block':'none';" href="javascript:void(0)">
<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"/>
</a>
<div id="toomiks" style = "display:none">
<table>
<%
var current = "";
for(webtoon in list){
if(current!=list[webtoon].week && list[webtoon].site == 'toomiks'){
if(current!=""){
%>
</tr>
<% } %>
<tr>
<th><%= list[webtoon].week %></th>
<% } %>
<%
if(list[webtoon].site == 'toomiks')
{
%>
<td>
<a href="<%= list[webtoon].webtoon_link %>">
<img alt="img" width="83" height="90" src="<%= list[webtoon].thum_link %>"/>
</a>
<%= list[webtoon].name %>
</td>
<%
}
%>
<%
if(current!=list[webtoon].week) {
current = list[webtoon].week;
%>
<%
}
}
%>
</tr>
</table>
</br>
</div>
......
......@@ -3,7 +3,7 @@
<head>
<title>내툰</title>
<link rel='stylesheet' href='/stylesheets/style2.css' />
<<!-- Bootstrap -->
<!-- Bootstrap -->
<link rel="stylesheet" type="text/css" href="/stylesheets/bootstrap.css">
<link rel="stylesheet" type="text/css" href="/stylesheets/font-awesome.css">
......
......@@ -4,7 +4,7 @@
<meta charset="UTF-8">
<title>웹툰 담기</title>
<link rel='stylesheet' href='/stylesheets/style2.css' />
<<!-- Bootstrap -->
<!-- Bootstrap -->
<link rel="stylesheet" type="text/css" href="/stylesheets/bootstrap.css">
<link rel="stylesheet" type="text/css" href="/stylesheets/font-awesome.css">
......
......@@ -2,8 +2,8 @@
<html>
<head>
<title>니툰</title>
<link rel='stylesheet' href='/stylesheets/style2.css' />
<<!-- Bootstrap -->
<link rel='stylesheet' href='/stylesheets/style2.css'>
<!-- Bootstrap -->
<link rel="stylesheet" type="text/css" href="/stylesheets/bootstrap.css">
<link rel="stylesheet" type="text/css" href="/stylesheets/font-awesome.css">
......@@ -54,7 +54,8 @@
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<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>
<a class="navbar-brand page-scroll" href="#page-top" style="font-family:Gugi">니툰</a> </div>
<a class="navbar-brand page-scroll" href="#page-top" style="font-family:Gugi">니툰</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
......