SW0000J

파일명 변경, 불필요 파일 정리

var express = require('express'); // web server 사용
var fs = require('fs'); // file load
var app = express();
var port = 80;
app.listen(port, function(){
console.log('Server Start');
})
app.get('/', function(req, res){
fs.readFile('WebTest.html', function(error, data){
if(error){
console.log(error);
}else{
res.writeHead(200, {'Content-Type': 'text/html'});
res.end(data);
}
})
})
\ No newline at end of file
var express = require('express');
var path = require('path');
var bodyParser = require('body-parser');
var request = require('request');
var fs = require('fs');
var ejs = require('ejs');
var indexRouter = require('./routes/index');
var ncRouter = require('./routes/nc');
var app = express();
const PORT = 80;
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');
app.use(express.static(path.join(__dirname, 'public')));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use('/', indexRouter);
app.use('/nc', ncRouter);
app.listen(PORT, function(){
console.log('Code run in https://localhost:'+PORT+'\n');
});
......@@ -12,7 +12,7 @@ const getHtml = async () => {
};
const getXports = async () => {
const getChosun = async () => {
return new Promise((resolve, reject) => {
getHtml()
......@@ -42,4 +42,4 @@ const getXports = async () => {
});
};
module.exports = getXports;
module.exports = getChosun;
......
......@@ -5,7 +5,7 @@ h1,h2,h3,h4,h5,h6{font-weight:normal;font-family:'맑은 고딕','Malgun Gothic'
p,li,dt,dd,span,strong,em,b,input,button,select,textarea,label,a{font-weight:normal;font-family:'맑은 고딕','Malgun Gothic',AppleSDGothicNeo-Regular,Arial,Helvetica,sans-serif;}
a{display:inline-block;vertical-align:top;}
h1,h2,h3,h4,h5,h6{margin:0;padding:0;font:inherit;font-weight:bold;}
h1,h2,h3,h4,h5,h6{margin:200;padding:200;font:inherit;font-weight:bold;}
img{display:inline-block;border:0 none;vertical-align:top;}
cite,code,dfn,del,em,ins,label,q,span,strong,b,i,time,mark,font,kbd,q,s,samp,small,strike,sub,sup,tt,var,u,center{display:inline-block;margin:0;padding:0;vertical-align:top;font:inherit;}
address,cite,em,dfn{font:inherit;}
......@@ -41,7 +41,7 @@ a:focus{color:inherit;}
[class*='title-type'] .tit{font-size:18px;line-height:22px;}
[class*='title-type'].bold .tit{font-weight:bold;}
[class*='title-type'] .txt{margin-left:6px;color:#666;font-size:10px;line-height:12px;letter-spacing:0;}
[class*='title-type'] .tit+.txt{margin-left:6px;}
[class*='title-type'] .tit+.txt{margin-left:20px;}
/* =============== List type ======================== */
[class*='list-type']{font-size:0;line-height:1;}
......@@ -57,8 +57,8 @@ a:focus{color:inherit;}
.display-none{display:none;}
/* title-type04 */
.title-type04[class*='arr'] .tit{padding-right:17px;}
.title-type04 .tit{font-size:20px;line-height:22px;}
.title-type04[class*='arr'] .tit{padding-right:20px;}
.title-type04 .tit{font-size:40px;line-height:40px;}
.img-cover{overflow:hidden;}
......@@ -79,3 +79,35 @@ a:focus{color:inherit;}
.list-type038 .info-box01{width:110px;}
.list-type038 .info-box01 .txt-time{padding-top:4px;color:#666;font-size:12px;line-height:14px;letter-spacing:0;}
.list-type038 .item-box01 .info-box02{width:156px;padding:0 20px 0 0;vertical-align:middle;text-align:right;}
/* 공통여백 */
.container>[class*='content']+[class*='content']{margin-top:35px;}
body:not(.page-main) .container>[class*='content']:last-child{padding-bottom:100px;}
[class*='box-type']{margin-top:35px;}
[class*='box-type'] [class*='paging-type01']{margin-top:35px;}
[class*='tab-content'] [class*='box-type'],
.title-page02+[class*='box-type'],
.container>[class*='content']>[class*='box-type']:first-child,
.section01>[class*='box-type']:first-child,
.section02>[class*='box-type']:first-child{margin-top:0;}
/* =============== Pager ======================== */
/* paging-type01 : 리스트 페이징 */
.paging-type01{font-size:0;text-align:center;}
.paging-type01>a,
.paging-type01 .num{display:inline-block;height:38px;margin:0 5px;vertical-align:top;}
.paging-type01 .first,
.paging-type01 .prev,
.paging-type01 .next,
.paging-type01 .last{position:relative;width:29px;height:38px}
.paging-type01 .first span,
.paging-type01 .prev span,
.paging-type01 .next span,
.paging-type01 .last span{overflow:hidden;position:absolute;top:50%;left:50%;width:11px;height:10px;font-size:1px;color:transparent;margin:-5px 0 0 -5px;background:url(../img/sprites_default01.png?v=20200610_1400) 0 0 no-repeat;}
.paging-type01 .first span{}
.paging-type01 .last span{}
.paging-type01 .prev span{background-position-x:-50px;}
.paging-type01 .next span{}
.paging-type01 .num{width:38px;height:38px;font-size:14px;line-height:38px;color:#000;background-color:#ebebeb;}
.paging-type01 .num.on{color:#fff;background-color:#213989;}
.paging-type01 .num:not(.on):hover{text-decoration:underline;}
\ No newline at end of file
......
var express = require('express');
var router = express.Router();
const getXports = require('../test1.js');
const getZum = require('../test2.js');
const getChosun = require('../test3.js');
const getYna = require('../test4.js')
const getXports = require('../xports.js');
const getZum = require('../zum.js');
const getChosun = require('../chosun.js');
const getYna = require('../yna.js')
let xports;
let zum;
let chosun;
let yna;
let newslist;
(async function() {
try {
xports = await getXports();
zum = await getZum();
chosun = await getChosun();
yna = await getYna();
console.log(xports);
console.log(zum);
console.log(chosun);
console.log(yna);
newslist = xports.concat(zum, chosun, yna);
console.log("index loaded");
} catch (e) {
return console.log(e);
}
......@@ -28,12 +29,8 @@ try {
router.get('/', function(req, res, next){
res.render('index', {
xports : xports,
zum : zum,
chosun : chosun,
yna : yna
newslist : newslist
});
});
console.log("started\n");
module.exports = router;
......
var express = require('express');
var router = express.Router();
const getXports = require('../xports.js');
const getZum = require('../zum.js');
const getChosun = require('../chosun.js');
const getYna = require('../yna.js')
let xports;
let zum;
let chosun;
let yna;
let newslist;
let nc = new Array();
(async function() {
try {
xports = await getXports();
zum = await getZum();
chosun = await getChosun();
yna = await getYna();
newslist = xports.concat(zum, chosun, yna);
for(var i of newslist){
if(i.title.indexOf('NC') !== -1 || i.title.indexOf('nc') !== -1 || i.title.indexOf('엔씨') !== -1 || i.summary.indexOf('NC') !== -1 || i.summary.indexOf('nc') !== -1 || i.summary.indexOf('엔씨') !== -1){
nc.push(i);
}
}
console.log("nc loaded");
} catch (e) {
return console.log(e);
}
})();
router.get('/', function(req, res, next){
res.render('nc', {
nc : nc
});
});
module.exports = router;
var express = require('express');
var path = require('path');
var bodyParser = require('body-parser');
var request = require('request');
var fs = require('fs');
var ejs = require('ejs');
var indexRouter = require('./routes/index');
var app = express();
const PORT = 80;
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');
app.use(express.static(path.join(__dirname, 'public')));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use('/', indexRouter);
app.listen(PORT, function(){
console.log('Code run in https://localhost:'+PORT);
});
/*
var express = require('express');
var app = express();
var bodyParser = require('body-parser');
var fs = require('fs');
const ejs = require('ejs');
var engines = require('consolidate');
const PORT = 80;
// 크롤링 한 list 받아오기
const xports = require('./test1.js');
const zum = require('./test2.js');
const chosun = require('./test3.js');
const yna = require('./test4.js');
//console.log(xports.xports);
//console.log(zum.zum);
//console.log(chosun.chosun);
//console.log(yna.yna);
// router 설정
var indexRouter = require('./routes/index');
app.use(express.json());
app.use(express.urlencoded({extended:false}));
app.use(express.static('public'))
app.set('news', __dirname + '/news');
//화면 engine 설정
app.engine('html', engines.mustache);
app.set('news engine', 'ejs');
// main 화면
app.use('/', indexRouter);
// 서버 생성
app.listen(PORT, function(){
console.log('Code run in https://localhost:'+PORT);
});
*/
@charset "utf-8";
/*************************************************
프로젝트명 : 연합뉴스 국문 모바일 홈페이지 (2019)
commnet : default
original : /global/guide/v01/css/default_v.0.2.css
version : 0.2
modify : 2019-04-01
*************************************************/
html,body{width:100%;height:100%;margin:0;padding:0;}
body{font-weight:normal;font-size:1em;line-height:1.5em;font-family:sans-serif;color:#000;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;}
h1,h2,h3,h4,h5,h6{margin:0;padding:0;font:inherit;font-weight:bold;}
img{display:inline-block;border:0 none;vertical-align:top;}
cite,code,dfn,del,em,ins,label,q,span,strong,b,i,time,mark,font,kbd,q,s,samp,small,strike,sub,sup,tt,var,u,center{display:inline-block;margin:0;padding:0;vertical-align:top;font:inherit;}
address,cite,em,dfn{font:inherit;}
b,i,strong,optgroup{font:inherit;font-weight:bold;}
blockquote,p{margin:0;padding:0;font:inherit;}
pre{overflow:auto;margin:0;padding:0;font:inherit;}
mark{background:#fff;font:inherit;/* color:#000; */} /* IE 8/9 */
sub,sup{position:relative;font-size:0.75em;vertical-align:baseline;font:inherit;}
abbr[title]{border-bottom:1px dotted;font:inherit;}
hr{display:none;}
div,article,aside,main,menu,details,figure,figcaption,hgroup,footer,header,nav,section,object,summary,iframe{display:block;margin:0;padding:0;font:inherit;}
iframe{overflow:hidden;border:none;}
audio,canvas,progress,video{display:inline-block;margin:0;padding:0;vertical-align:baseline;}
audio:not([controls]){display:none;height:0;}
[hidden],template{display:none;}
svg:not(:root){overflow:hidden;} /* IE 9~11 */
/* table */
table{border-collapse:collapse;border-spacing:0;}
caption{overflow:hidden;visibility:hidden;width:0;height:0;margin:0;padding:0;font-size:0;line-height:0;text-indent:-9999px;}
th,td{margin:0;padding:0;font:inherit;text-align:left;vertical-align:middle;}
/* list */
dl,dd,ol,ul,li{margin:0;padding:0;}
li{list-style-type:none;}
/* form */
form{margin:0;padding:0;}
fieldset{margin:0;padding:0;border:0 none;}
legend{overflow:hidden;visibility:hidden;position:absolute;top:0;left:0;width:0;height:0;margin:0;padding:0;font-size:0;line-height:0;}
input,button,select,textarea{margin:0;padding:0;font:inherit;vertical-align:top;}
input.text{padding:4px 7px 4px;border:1px solid #ccc;font-size:12px;line-height:1;color:#000;}
input.readonly{background-color:#eee;}
input.check,input.radio{width:13px;height:13px;margin:2px 7px 0 0;padding:0;}
input[type="button"],
input[type="reset"],
input[type="submit"]{-webkit-appearance:button;cursor:pointer;}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button{height:auto;}
input[type="search"]{-webkit-appearance:textfield;box-sizing:content-box;}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration{-webkit-appearance:none;}
textarea{margin:0;padding:0;border:1px solid #ccc;font-size:12px;color:#000;resize:none;}
select{height:20px;margin:0;border:1px solid #ccc;outline:none;background-color:#fff;font-size:12px;color:#000;vertical-align:top;text-transform:none;}
button{overflow:visible;text-transform:none;cursor:pointer;}
button::-moz-focus-inner,
input::-moz-focus-inner{padding:0;border:0;}
button[disabled],html input[disabled]{cursor:default;}
/* link */
a{font:inherit;color:inherit;text-decoration:none;cursor:pointer;}
a{background-color:transparent;} /* IE10 active transparent remove */
a:link,
a:visited,
a:active,
a:focus{color:inherit;}
/* selection */
/* PC 국문 개편에서는 설정 안 함 */
/* ::selection{opacity:0.1;background:#fff2a8;}
::-moz-selection{background:#fff2a8;} */
/* skip navigation */
#skipNav{position:relative;z-index:800;}
#skipNav a{overflow:hidden;position:absolute;width:1px;height:1px;margin-bottom:-1px;}
#skipNav a:focus,#skipNav a:active{overflow:auto;display:block;position:absolute;width:100%;height:30px;margin:0;background-color:#fff000;font-weight:bold;font-size:14px;line-height:30px;color:#000;text-align:center;z-index:100;}
/* clear */
.clear:after{content:".";visibility:hidden;display:block;clear:both;height:0;font-size:0;line-height:0;}
.clear{display:inline-block;}
*html .clear{height:0;}
.clear{display:block;}
.clear-both{clear:both;}
/* basic */
.hidden-obj{position:absolute;visibility:hidden;top:-9999px;left:-9999px;}
.blind{overflow:hidden;visibility:hidden;position:absolute;top:0;left:0;width:0;height:0;padding:0;font-size:0;line-height:0;}
.display-none{display:none;}
.for-mobile{display:none}
.visible-hidden{visibility:hidden;}
.word-break{word-break:break-all !important;}
.text-indent{overflow:hidden;display:block;text-indent:-9999px;}
.text-c{text-align:center !important;}
.text-l{text-align:left !important;}
.text-r{text-align:right !important;}
.vt-t{vertical-align:top !important;}
.vt-m{vertical-align:middle !important;}
.vt-b{vertical-align:bottom !important;}
.fw-b{font-weight:bold !important;}
.fw-n{font-weight:normal !important;}
.fl-l{float:left;}
.fl-r{float:right;}
.fn{float:none !important;}
.bg-none{background:none !important;}
.bd-n{border:none !important;}
.bd-t{border-top:none !important;}
.bd-r{border-right:none !important;}
.bd-b{border-bottom:none !important;}
.bd-l{border-left:none !important;}
.of-a{overflow:auto;}
.of-h{overflow:hidden;}
.scroll-x{overflow-x:scroll;}
.scroll-y{overflow-y:scroll;}
.mg-none{margin:0 !important;}
\ No newline at end of file
......@@ -19,84 +19,22 @@
</div>
<section class = 'box-type box-latest01'>
<strong class="hidden-obj">야구 기사 목록</strong>
<div class = "paging paging-type01">
<strong class = "num on">All</strong>
<a href="/nc" class="num">NC</a>
<a href="/lg" class="num">LG</a>
<a href="/doosan" class="num">두산</a>
<a href="/kiwoom" class="num">키움</a>
<a href="/kia" class="num">KIA</a>
<a href="/lotte" class="num">롯데</a>
<a href="/samsung" class="num">삼성</a>
<a href="/kt" class="num">KT</a>
<a href="/sk" class="num">SK</a>
<a href="/hanwha" class="num">한화</a>
</div>
<div class = "list-type038">
<ul class = "list">
<% for(var i of xports) { %>
<li>
<div class='item-box01'>
<div class='info-box01'>
<span class="blind">송고시간</span>
<span class='txt-time'><%= i.datetime %></span>
</div>
<% if (i.image_url != undefined) { %>
<figure class='img-con'>
<a class = "img img-cover imgLiquid_bgSize imgLiquid_ready" style = "background-size: cover; background-position: center top; background-repeat: no-repeat;" href = <%= i.url %> >
<img src = <%= i.image_url %>>
</a>
</figure>
<% } %>
<div class='news-con'>
<a class = 'tit-wrap' href = <%= i.url %>>
<strong class = 'tit-news'><%= i.title %></strong>
</a>
<p class = "lead">
<%= i.summary %>
</p>
</div>
</div>
</li>
<% } %>
<% for(var i of zum) { %>
<li>
<div class='item-box01'>
<div class='info-box01'>
<span class="blind">송고시간</span>
<span class='txt-time'><%= i.datetime %></span>
</div>
<% if (i.image_url != undefined) { %>
<figure class='img-con'>
<a class = "img img-cover imgLiquid_bgSize imgLiquid_ready" style = "background-size: cover; background-position: center top; background-repeat: no-repeat;" href = <%= i.url %> >
<img src = <%= i.image_url %>>
</a>
</figure>
<% } %>
<div class='news-con'>
<a class = 'tit-wrap' href = <%= i.url %>>
<strong class = 'tit-news'><%= i.title %></strong>
</a>
<p class = "lead">
<%= i.summary %>
</p>
</div>
</div>
</li>
<% } %>
<% for(var i of chosun) { %>
<li>
<div class='item-box01'>
<div class='info-box01'>
<span class="blind">송고시간</span>
<span class='txt-time'><%= i.datetime %></span>
</div>
<% if (i.image_url != undefined) { %>
<figure class='img-con'>
<a class = "img img-cover imgLiquid_bgSize imgLiquid_ready" style = "background-size: cover; background-position: center top; background-repeat: no-repeat;" href = <%= i.url %> >
<img src = <%= i.image_url %>>
</a>
</figure>
<% } %>
<div class='news-con'>
<a class = 'tit-wrap' href = <%= i.url %>>
<strong class = 'tit-news'><%= i.title %></strong>
</a>
<p class = "lead">
<%= i.summary %>
</p>
</div>
</div>
</li>
<% } %>
<% for(var i of yna) { %>
<% for(var i of newslist) { %>
<li>
<div class='item-box01'>
<div class='info-box01'>
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="/stylesheets/style.css" />
<title>YaguMoa[ossswoo.tk]</title>
</head>
<body class = "body-news-list page-sports body-static" data-nav="sports">
<div id = "container" class = "wrap-container">
<div class = "container">
<div class = 'content03 width1100 line01'>
<div class = "section01">
<div class = 'title-page02'>
<h1 class = "title-type04 bold">
<span class = "tit">야구 모아</span>
</h1>
</div>
<section class = 'box-type box-latest01'>
<strong class="hidden-obj">NC 목록</strong>
<div class = "paging paging-type01">
<a href="/" class="num">All</a>
<strong class = "num on">NC</strong>
<a href="/lg" class="num">LG</a>
<a href="/doosan" class="num">두산</a>
<a href="/kiwoom" class="num">키움</a>
<a href="/kia" class="num">KIA</a>
<a href="/lotte" class="num">롯데</a>
<a href="/samsung" class="num">삼성</a>
<a href="/kt" class="num">KT</a>
<a href="/sk" class="num">SK</a>
<a href="/hanwha" class="num">한화</a>
</div>
<div class = "list-type038">
<ul class = "list">
<% for(var i of nc) { %>
<li>
<div class='item-box01'>
<div class='info-box01'>
<span class="blind">송고시간</span>
<span class='txt-time'><%= i.datetime %></span>
</div>
<% if (i.image_url != undefined) { %>
<figure class='img-con'>
<a class = "img img-cover imgLiquid_bgSize imgLiquid_ready" style = "background-size: cover; background-position: center top; background-repeat: no-repeat;" href = <%= i.url %> >
<img src = <%= i.image_url %>>
</a>
</figure>
<% } %>
<div class='news-con'>
<a class = 'tit-wrap' href = <%= i.url %>>
<strong class = 'tit-news'><%= i.title %></strong>
</a>
<p class = "lead">
<%= i.summary %>
</p>
</div>
</div>
</li>
<% } %>
</ul>
</div>
</section>
</div>
</div>
</div>
</div>
</body>
</html>
......@@ -12,7 +12,7 @@ const getHtml = async () => {
};
const getXports = async () => {
const getYna = async () => {
return new Promise((resolve, reject) => {
getHtml()
......@@ -42,4 +42,4 @@ const getXports = async () => {
});
};
module.exports = getXports;
module.exports = getYna;
......
......@@ -12,7 +12,7 @@ const getHtml = async () => {
};
const getXports = async () => {
const getZum = async () => {
return new Promise((resolve, reject) => {
getHtml()
......@@ -42,4 +42,4 @@ const getXports = async () => {
});
};
module.exports = getXports;
module.exports = getZum;
......