윤혜원

다음 웹툰allToons 배열에 삽입 성공!

......@@ -3,7 +3,10 @@
<component name="ChangeListManager">
<list default="true" id="ffe1a490-8fdb-4611-8537-4d1c03c40b8d" name="Default" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/routes/daum.js" beforeDir="false" afterPath="$PROJECT_DIR$/routes/daum.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app.js" beforeDir="false" afterPath="$PROJECT_DIR$/app.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/routes/daum.js" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/routes/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/routes/index.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/views/index.ejs" beforeDir="false" afterPath="$PROJECT_DIR$/views/index.ejs" afterDir="false" />
</list>
<ignored path="$PROJECT_DIR$/out/" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
......@@ -55,7 +58,7 @@
<session id="872999261">
<usages-collector id="statistics.lifecycle.project">
<counts>
<entry key="project.closed" value="9" />
<entry key="project.closed" value="10" />
<entry key="project.open.time.10" value="1" />
<entry key="project.open.time.11" value="2" />
<entry key="project.open.time.15" value="2" />
......@@ -69,9 +72,10 @@
<usages-collector id="statistics.file.extensions.open">
<counts>
<entry key="css" value="3" />
<entry key="ejs" value="27" />
<entry key="daum" value="3" />
<entry key="ejs" value="32" />
<entry key="iml" value="2" />
<entry key="js" value="30" />
<entry key="js" value="33" />
<entry key="json" value="2" />
<entry key="www" value="1" />
</counts>
......@@ -79,22 +83,23 @@
<usages-collector id="statistics.file.types.open">
<counts>
<entry key="CSS" value="3" />
<entry key="EJS" value="27" />
<entry key="EJS" value="35" />
<entry key="IDEA_MODULE" value="2" />
<entry key="JSON" value="2" />
<entry key="JavaScript" value="31" />
<entry key="JavaScript" value="34" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.extensions.edit">
<counts>
<entry key="ejs" value="63" />
<entry key="js" value="934" />
<entry key="daum" value="1" />
<entry key="ejs" value="117" />
<entry key="js" value="2392" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.types.edit">
<counts>
<entry key="EJS" value="63" />
<entry key="JavaScript" value="934" />
<entry key="EJS" value="118" />
<entry key="JavaScript" value="2392" />
</counts>
</usages-collector>
</session>
......@@ -102,55 +107,28 @@
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/views/index.ejs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="228">
<caret line="12" selection-start-line="12" selection-end-line="12" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/routes/setting.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1292">
<caret line="68" selection-start-line="68" selection-end-line="68" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/routes/mytoons.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="190">
<caret line="10" selection-start-line="10" selection-end-line="10" />
<caret line="10" lean-forward="true" selection-start-line="10" selection-end-line="10" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/routes/index.js">
<entry file="file://$PROJECT_DIR$/routes/setting.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="76">
<caret line="4" column="34" selection-start-line="4" selection-start-column="34" selection-end-line="4" selection-end-column="34" />
<state relative-caret-position="190">
<caret line="10" column="21" lean-forward="true" selection-start-line="10" selection-start-column="21" selection-end-line="10" selection-end-column="21" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/routes/daum.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="274">
<caret line="88" lean-forward="true" selection-start-line="88" selection-end-line="88" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/views/mytoons.ejs">
<entry file="file://$PROJECT_DIR$/routes/index.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="722">
<caret line="38" column="9" selection-start-line="38" selection-start-column="9" selection-end-line="38" selection-end-column="9" />
<state relative-caret-position="171">
<caret line="153" column="41" lean-forward="true" selection-start-line="153" selection-start-column="41" selection-end-line="153" selection-end-column="41" />
</state>
</provider>
</entry>
......@@ -158,17 +136,8 @@
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1653">
<caret line="87" selection-start-line="87" selection-end-line="87" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/routes/toonviewer.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="589">
<caret line="31" column="7" selection-start-line="31" selection-start-column="7" selection-end-line="31" selection-end-column="7" />
<state relative-caret-position="293">
<caret line="76" column="39" lean-forward="true" selection-start-line="76" selection-start-column="39" selection-end-line="76" selection-end-column="39" />
</state>
</provider>
</entry>
......@@ -195,7 +164,6 @@
<find>done(</find>
<find>user_id</find>
<find>quer</find>
<find>connection</find>
<find>노블레스</find>
<find>패밀리</find>
<find>console</find>
......@@ -212,6 +180,8 @@
<find>myStateValue</find>
<find>server</find>
<find>connec</find>
<find>connection</find>
<find>로그인 쿼리</find>
</findStrings>
<dirStrings>
<dir>$PROJECT_DIR$/views</dir>
......@@ -245,7 +215,6 @@
<option value="$PROJECT_DIR$/models/user.js" />
<option value="$PROJECT_DIR$/package.json" />
<option value="$APPLICATION_CONFIG_DIR$/consoles/db/01265fc0-37d6-481f-ac14-42262cda0ac3/console.sql" />
<option value="$PROJECT_DIR$/views/index.ejs" />
<option value="$PROJECT_DIR$/views/setting.ejs" />
<option value="$PROJECT_DIR$/views/toonviewer.html" />
<option value="$PROJECT_DIR$/views/toonviewer.ejs" />
......@@ -254,9 +223,12 @@
<option value="$PROJECT_DIR$/routes/setting.js" />
<option value="$PROJECT_DIR$/routes/toonviewer.js" />
<option value="$PROJECT_DIR$/views/mytoons.ejs" />
<option value="$PROJECT_DIR$/views/daum" />
<option value="$PROJECT_DIR$/views/daum.ejs" />
<option value="$PROJECT_DIR$/views/index.ejs" />
<option value="$PROJECT_DIR$/routes/daum.js" />
<option value="$PROJECT_DIR$/app.js" />
<option value="$PROJECT_DIR$/routes/index.js" />
<option value="$PROJECT_DIR$/routes/daum.js" />
</list>
</option>
</component>
......@@ -479,7 +451,7 @@
<workItem from="1543286438979" duration="9178000" />
<workItem from="1543299644956" duration="10319000" />
<workItem from="1543393354798" duration="25000" />
<workItem from="1543459526992" duration="2772000" />
<workItem from="1543459526992" duration="19576000" />
</task>
<task id="LOCAL-00001" summary="초기 commit by intellij">
<created>1512174269218</created>
......@@ -499,7 +471,7 @@
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="195060000" />
<option name="totallyTimeSpent" value="211864000" />
</component>
<component name="TodoView">
<todo-panel id="selected-file">
......@@ -512,9 +484,8 @@
</component>
<component name="ToolWindowManager">
<frame x="-7" y="-7" width="1550" height="838" extended-state="6" />
<editor active="true" />
<layout>
<window_info active="true" content_ui="combo" id="Project" order="0" sideWeight="0.48880598" visible="true" weight="0.16523464" />
<window_info content_ui="combo" id="Project" order="0" sideWeight="0.48880598" visible="true" weight="0.16523464" />
<window_info id="Structure" order="1" weight="0.24964234" />
<window_info id="npm" order="2" sideWeight="0.51119405" side_tool="true" weight="0.16523606" />
<window_info id="Image Layers" order="3" />
......@@ -523,7 +494,7 @@
<window_info id="Capture Tool" order="6" />
<window_info id="Favorites" order="7" side_tool="true" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" weight="0.329602" />
<window_info anchor="bottom" id="Find" order="1" weight="0.32954547" />
<window_info anchor="bottom" id="Run" order="2" sideWeight="0.49713877" weight="0.3693182" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.39925373" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
......@@ -545,34 +516,35 @@
<window_info anchor="right" id="Maven Projects" order="8" />
</layout>
<layout-to-restore>
<window_info content_ui="combo" id="Project" order="0" sideWeight="0.48880598" visible="true" weight="0.16523606" />
<window_info active="true" content_ui="combo" id="Project" order="0" sideWeight="0.48880598" visible="true" weight="0.16523464" />
<window_info id="Structure" order="1" weight="0.24964234" />
<window_info id="Capture Tool" order="2" />
<window_info id="Designer" order="3" />
<window_info id="UI Designer" order="4" />
<window_info id="Image Layers" order="5" />
<window_info id="npm" order="6" sideWeight="0.51119405" side_tool="true" weight="0.16523606" />
<window_info id="npm" order="2" sideWeight="0.51119405" side_tool="true" weight="0.16523606" />
<window_info id="Image Layers" order="3" />
<window_info id="Designer" order="4" />
<window_info id="UI Designer" order="5" />
<window_info id="Capture Tool" order="6" />
<window_info id="Favorites" order="7" side_tool="true" />
<window_info anchor="bottom" id="Database Console" order="0" weight="0.329602" />
<window_info anchor="bottom" id="Message" order="1" />
<window_info anchor="bottom" id="Find" order="2" weight="0.329602" />
<window_info anchor="bottom" id="Run" order="3" sideWeight="0.49713877" visible="true" weight="0.329602" />
<window_info anchor="bottom" id="Debug" order="4" weight="0.39925373" />
<window_info anchor="bottom" id="Cvs" order="5" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="6" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="7" />
<window_info anchor="bottom" id="Event Log" order="8" sideWeight="0.5028612" side_tool="true" weight="0.329602" />
<window_info anchor="bottom" id="Version Control" order="9" weight="0.329602" />
<window_info anchor="bottom" id="Terminal" order="10" weight="0.329602" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" weight="0.329602" />
<window_info anchor="bottom" id="Run" order="2" sideWeight="0.49713877" weight="0.3693182" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.39925373" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" weight="0.32911393" />
<window_info anchor="bottom" id="Event Log" order="7" sideWeight="0.5028612" side_tool="true" weight="0.329602" />
<window_info anchor="bottom" id="Version Control" order="8" weight="0.32911393" />
<window_info anchor="bottom" id="Terminal" order="9" weight="0.32911393" />
<window_info anchor="bottom" id="Database Console" order="10" weight="0.329602" />
<window_info anchor="bottom" id="Docker" order="11" show_stripe_button="false" />
<window_info anchor="right" id="Commander" order="0" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
<window_info anchor="right" id="Palette" order="3" />
<window_info anchor="right" id="Maven Projects" order="4" />
<window_info anchor="right" id="Database" order="5" weight="0.3297568" />
<window_info anchor="right" id="Palette&#9;" order="6" />
<window_info anchor="right" id="Capture Analysis" order="7" />
<window_info anchor="right" id="Theme Preview" order="8" />
<window_info anchor="right" id="Capture Analysis" order="4" />
<window_info anchor="right" id="Theme Preview" order="5" />
<window_info anchor="right" id="Database" order="6" weight="0.29613733" />
<window_info anchor="right" id="Palette&#9;" order="7" />
<window_info anchor="right" id="Maven Projects" order="8" />
</layout-to-restore>
</component>
<component name="TypeScriptGeneratedFilesManager">
......@@ -672,13 +644,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/views/error.ejs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="57">
<caret line="3" lean-forward="true" selection-start-line="3" selection-end-line="3" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/views/toonviewer.ejs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="247">
......@@ -693,66 +658,87 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/routes/users.js">
<entry file="file://$PROJECT_DIR$/views/error.ejs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="76">
<caret line="4" column="42" lean-forward="true" selection-start-line="4" selection-start-column="42" selection-end-line="4" selection-end-column="42" />
<state relative-caret-position="57">
<caret line="3" lean-forward="true" selection-start-line="3" selection-end-line="3" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/views/index.ejs">
<entry file="file://$PROJECT_DIR$/views/mytoons.ejs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="228">
<caret line="12" selection-start-line="12" selection-end-line="12" />
<state relative-caret-position="513">
<caret line="27" column="11" lean-forward="true" selection-start-line="27" selection-start-column="11" selection-end-line="27" selection-end-column="11" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/routes/setting.js">
<entry file="file://$PROJECT_DIR$/routes/toonviewer.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1292">
<caret line="68" selection-start-line="68" selection-end-line="68" />
<state relative-caret-position="-418">
<caret line="5" lean-forward="true" selection-start-line="5" selection-end-line="5" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/views/daum">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="171">
<caret line="9" lean-forward="true" selection-start-line="9" selection-end-line="9" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/routes/users.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="133">
<caret line="7" lean-forward="true" selection-start-line="7" selection-end-line="7" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/routes/mytoons.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="190">
<caret line="10" selection-start-line="10" selection-end-line="10" />
<caret line="10" lean-forward="true" selection-start-line="10" selection-end-line="10" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/routes/index.js">
<entry file="file://$PROJECT_DIR$/views/index.ejs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="76">
<caret line="4" column="34" selection-start-line="4" selection-start-column="34" selection-end-line="4" selection-end-column="34" />
<state relative-caret-position="171">
<caret line="9" lean-forward="true" selection-start-line="9" selection-end-line="9" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/views/mytoons.ejs">
<entry file="file://$PROJECT_DIR$/views/daum.ejs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="722">
<caret line="38" column="9" selection-start-line="38" selection-start-column="9" selection-end-line="38" selection-end-column="9" />
<state relative-caret-position="350">
<caret line="31" column="10" lean-forward="true" selection-start-line="31" selection-start-column="10" selection-end-line="31" selection-end-column="10" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app.js">
<entry file="file://$PROJECT_DIR$/routes/setting.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1653">
<caret line="87" selection-start-line="87" selection-end-line="87" />
<state relative-caret-position="190">
<caret line="10" column="21" lean-forward="true" selection-start-line="10" selection-start-column="21" selection-end-line="10" selection-end-column="21" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/routes/toonviewer.js">
<entry file="file://$PROJECT_DIR$/routes/daum.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="589">
<caret line="31" column="7" selection-start-line="31" selection-start-column="7" selection-end-line="31" selection-end-column="7" />
<state relative-caret-position="-790">
<caret line="107" column="27" lean-forward="true" selection-start-line="107" selection-start-column="27" selection-end-line="107" selection-end-column="27" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/routes/daum.js">
<entry file="file://$PROJECT_DIR$/app.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="293">
<caret line="76" column="39" lean-forward="true" selection-start-line="76" selection-start-column="39" selection-end-line="76" selection-end-column="39" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/routes/index.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="274">
<caret line="88" lean-forward="true" selection-start-line="88" selection-end-line="88" />
<state relative-caret-position="171">
<caret line="153" column="41" lean-forward="true" selection-start-line="153" selection-start-column="41" selection-end-line="153" selection-end-column="41" />
</state>
</provider>
</entry>
......
......@@ -13,7 +13,8 @@ var mytoons = require('./routes/mytoons');
var passport = require('passport');
var setting = require('./routes/setting');
var session = require('express-session');
var toonviewer = require('./routes/toonviewer')
var toonviewer = require('./routes/toonviewer');
//port
......@@ -61,6 +62,7 @@ app.use('/users', users);
app.use('/mytoons', mytoons);
app.use('/setting', setting);
app.use('/toonviewer', toonviewer);
//app.use('/daum', daum);
//app.use(express.static('views'));
......
var client = require('cheerio-httpcli');
//월요일 웹툰
var mon='mon'
var daum = `http://webtoon.daum.net/data/pc/webtoon/list_serialized/${mon}?timeStamp=1515819276574`;
client.fetch(daum, {}, function (err, $, res, body) {
var data = JSON.parse(body);
var list = data["data"];
list.forEach(function(item, idx){
//다음 웹툰 아이디, 제목, 요일
console.log(item.id + ' ' + item.title + ' ' + mon);
});
});
//화요일 웹툰
var tue='tue'
var daum = `http://webtoon.daum.net/data/pc/webtoon/list_serialized/${tue}?timeStamp=1515819276574`;
client.fetch(daum, {}, function (err, $, res, body) {
var data = JSON.parse(body);
var list = data["data"];
list.forEach(function(item, idx){
//다음 웹툰 아이디, 제목, 요일
console.log(item.id + ' ' + item.title + ' ' + tue);
});
});
//수요일 웹툰
var wed='wed'
var daum = `http://webtoon.daum.net/data/pc/webtoon/list_serialized/${wed}?timeStamp=1515819276574`;
client.fetch(daum, {}, function (err, $, res, body) {
var data = JSON.parse(body);
var list = data["data"];
list.forEach(function(item, idx){
//다음 웹툰 아이디, 제목, 요일
console.log(item.id + ' ' + item.title + ' ' + wed);
});
});
//목요일 웹툰
var thu='thu'
var daum = `http://webtoon.daum.net/data/pc/webtoon/list_serialized/${thu}?timeStamp=1515819276574`;
client.fetch(daum, {}, function (err, $, res, body) {
var data = JSON.parse(body);
var list = data["data"];
list.forEach(function(item, idx){
//다음 웹툰 아이디, 제목, 요일
console.log(item.id + ' ' + item.title + ' ' + thu);
});
});
//금요일웹툰
var fri='fri';
var daum1 = `http://webtoon.daum.net/data/pc/webtoon/list_serialized/${fri}?timeStamp=1515819276574`;
client.fetch(daum1, {}, function (err, $, res, body) {
var data = JSON.parse(body);
var list1 = data["data"];
list1.forEach(function(item, idx){
//다음 웹툰 아이디, 제목, 요일
console.log(item.id + ' ' + item.title + ' ' + fri);
});
});
//토요일 웹툰
var sat='sat'
var daum = `http://webtoon.daum.net/data/pc/webtoon/list_serialized/${sat}?timeStamp=1515819276574`;
client.fetch(daum, {}, function (err, $, res, body) {
var data = JSON.parse(body);
var list = data["data"];
list.forEach(function(item, idx){
//다음 웹툰 아이디, 제목, 요일
console.log(item.id + ' ' + item.title + ' ' + sat);
});
});
//일요일 웹툰
var sun='sun'
var daum = `http://webtoon.daum.net/data/pc/webtoon/list_serialized/${sun}?timeStamp=1515819276574`;
client.fetch(daum, {}, function (err, $, res, body) {
var data = JSON.parse(body);
var list = data["data"];
list.forEach(function(item, idx){
//다음 웹툰 아이디, 제목, 요일
console.log(item.id + ' ' + item.title + ' ' + sun);
});
});
\ No newline at end of file
......@@ -3,6 +3,7 @@ var cheerio = require('cheerio');
var request = require('request');
var router = express.Router();
var mysql = require('mysql');
var client = require('cheerio-httpcli');
var passport = require('passport'),
KakaoStrategy = require('passport-kakao').Strategy;
......@@ -41,8 +42,7 @@ router.get('/auth/login/kakao/callback',
function loginByThirdparty(accessToken, refreshToken, profile) {
var stmt_duplicated = 'INSERT INTO user(id) VALUES(?) ON DUPLICATE KEY UPDATE id=?;'
connection.query(stmt_duplicated, [profile._json.id,profile._json.id] , function (err, result) {
connection.query(stmt_duplicated, [profile._json.id] , function (err, result) {
if (err) {
console.log("로그인 쿼리중 에러 : " + err);
} else {
......@@ -92,8 +92,180 @@ function getLatestToon(titleid, day ,cb) {
}
function getAllToons() {
var allWeeklyToonsUrl = "http://comic.naver.com/webtoon/weekday.nhn";
allWebtoonList = new Array();
//월요일 다음 웹툰
var mon='mon';
var daum = `http://webtoon.daum.net/data/pc/webtoon/list_serialized/${mon}?timeStamp=1515819276574`;
var site='daum';
var mon_name='MON';
client.fetch(daum, {}, function (err, $, res, body) {
var data = JSON.parse(body);
var list = data["data"];
console.log(list);
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 : webtoon_link,
webtoon_link : webtoon_link,
week : mon_name,
site : site,
latest : 0
};
allWebtoonList.push(webtoon);
});
});
//화요일 다음 웹툰
var tue='tue';
var tue_name='TUE';
var daum1 = `http://webtoon.daum.net/data/pc/webtoon/list_serialized/${tue}?timeStamp=1515819276574`;
client.fetch(daum1, {}, 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 : webtoon_link,
webtoon_link : webtoon_link,
week : tue_name,
site : site,
latest : 0
};
allWebtoonList.push(webtoon);
});
});
//수요일 다음 웹툰
var wed='wed';
var wed_name='WED';
var daum2 = `http://webtoon.daum.net/data/pc/webtoon/list_serialized/${wed}?timeStamp=1515819276574`;
client.fetch(daum2, {}, function (err, $, res, body) {
var data = JSON.parse(body);
var list = data["data"];
list.forEach(function(item, idx){
console.log(item.id + ' ' + item.title + ' ' + wed);
var webtoon_link='http://webtoon.daum.net/webtoon/view/'+item.nickname.toString();
var webtoon= {
toon_index: item.id,
name : item.title,
thum_link : webtoon_link,
webtoon_link : webtoon_link,
week : wed_name,
site : site,
latest : 0
};
allWebtoonList.push(webtoon);
});
});
//목요일 다음 웹툰
var thu='thu';
var daum3 = `http://webtoon.daum.net/data/pc/webtoon/list_serialized/${thu}?timeStamp=1515819276574`;
var thu_name='THU';
client.fetch(daum3, {}, 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 : webtoon_link,
webtoon_link : webtoon_link,
week : thu_name,
site : site,
latest : 0
};
allWebtoonList.push(webtoon);
});
});
//금요일 다음 웹툰
var fri='fri';
var daum4 = `http://webtoon.daum.net/data/pc/webtoon/list_serialized/${fri}?timeStamp=1515819276574`;
var fri_name='FRI';
client.fetch(daum4, {}, function (err, $, res, body) {
var data = JSON.parse(body);
var list1 = data["data"];
list1.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 : webtoon_link,
webtoon_link : webtoon_link,
week : fri_name,
site : site,
latest : 0
};
allWebtoonList.push(webtoon);
});
});
//토요일 다음 웹툰
var sat='sat';
var daum5 = `http://webtoon.daum.net/data/pc/webtoon/list_serialized/${sat}?timeStamp=1515819276574`;
var sat_name='SAT';
client.fetch(daum5, {}, 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 : webtoon_link,
webtoon_link : webtoon_link,
week : sat_name,
site : site,
latest : 0
};
allWebtoonList.push(webtoon);
});
});
//일요일 다음 웹툰
var sun='sun';
var daum6 = `http://webtoon.daum.net/data/pc/webtoon/list_serialized/${sun}?timeStamp=1515819276574`;
var sun_name='SUN'
client.fetch(daum6, {}, 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 : webtoon_link,
webtoon_link : webtoon_link,
week : sun_name,
site : site,
latest : 0
};
allWebtoonList.push(webtoon);
});
});
var allWeeklyToonsUrl = "http://comic.naver.com/webtoon/weekday.nhn";
request(allWeeklyToonsUrl,function (err, res, html) {
if(!err){
var $ = cheerio.load(html);
......@@ -104,13 +276,14 @@ function getAllToons() {
var thumb_link = $(this).children().first().children().first().attr('src');
var name = $(this).next().text();
var titleid = webtoon_link.split('?')[1].split('&')[0].split('=')[1];
var site = 'naver'
var webtoon= {
toon_index: titleid,
name : name,
thum_link : thumb_link,
webtoon_link : webtoon_link,
week : week,
site : site,
latest : 0
};
......@@ -135,7 +308,7 @@ function getAllToons() {
}
});
allWebtoons = allWebtoonList;
}
};
getAllToons();
//처음 한번 수행
......
......@@ -8,13 +8,13 @@
<h1><%= title %></h1>
<p>웹툰 리스트</p>
<a href="/auth/login/kakao" class="btn btn-block btn-lg btn-warning btn_login">로그인</a>
<table>
<%
var current = "";
for(webtoon in list){
if(current!=list[webtoon].week){
if(current!=""){
%>
......