Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hyunjong Lee
/
YTMT
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Akhidjon
2019-06-06 20:17:48 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e9fada4a9537964dd00e29cf95ecae5880e61225
e9fada4a
1 parent
5dc28e8f
fixing errors
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
58 deletions
app.js
routes/index.js
app.js
View file @
e9fada4
...
...
@@ -77,7 +77,7 @@ app.use(express.static(path.join(__dirname, 'public')));
connection
=
mysql
.
createConnection
({
host
:
'localhost'
,
user
:
'root'
,
password
:
'
password
'
,
password
:
''
,
port
:
3306
,
database
:
'ytmt'
});
...
...
routes/index.js
View file @
e9fada4
...
...
@@ -193,8 +193,6 @@ function getDaumToons(_day) {
console
.
log
(
"다음웹툰 DB 에러 : "
+
err
);
}
else
{
list
.
forEach
(
function
(
item
,
idx
)
{
<<<<<<<
HEAD
var
webtoon_link
=
'http://webtoon.daum.net/webtoon/view/'
+
item
.
nickname
.
toString
();
var
webtoon
=
{
toon_index
:
item
.
id
,
...
...
@@ -208,7 +206,7 @@ function getDaumToons(_day) {
};
allWebtoonList
.
push
(
webtoon
);
=======
var
webtoon_link
=
'http://webtoon.daum.net/webtoon/view/'
+
item
.
nickname
.
toString
();
var
webtoon
=
{
toon_index
:
item
.
id
,
...
...
@@ -221,7 +219,6 @@ function getDaumToons(_day) {
};
daumCount
++
;
allWebtoonList
.
push
(
webtoon
);
>>>>>>>
0
b039040370950fe61e1c6ae5d5cf6650db9652f
});
}
});
...
...
@@ -236,8 +233,7 @@ function getNaverToons() {
var
webtoonCount
=
0
;
request
(
allWeeklyToonsUrl
,
function
(
err
,
res
,
html
)
{
<<<<<<<
HEAD
if
(
!
err
){
if
(
!
err
){
var
$
=
cheerio
.
load
(
html
);
var
p
=
Promise
.
resolve
();
var
eachs
=
$
(
".thumb"
).
each
(
function
(
i
)
{
...
...
@@ -274,66 +270,22 @@ function getNaverToons() {
}
});
})
=======
if
(
!
err
){
var
$
=
cheerio
.
load
(
html
);
var
p
=
Promise
.
resolve
();
var
eachs
=
$
(
".thumb"
).
each
(
function
(
i
)
{
var
week
=
$
(
this
).
parent
().
parent
().
prev
().
attr
(
'class'
);
var
webtoon_link
=
"http://comic.naver.com"
+
$
(
this
).
children
().
first
().
attr
(
'href'
);
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
};
naverCount
++
;
allWebtoonList
.
push
(
webtoon
);
});
})
}
})
}
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
];
connection
.
query
(
sql
,[
values
],
function
(
err
,
result
){
if
(
err
)
{
console
.
log
(
"웹툰 DB 에러 : "
+
err
);
}
else
{
webtoonCount
++
;
console
.
log
(
`웹툰
${
webtoonCount
}
개 DB처리 완료!`
);
}
>>>>>>>
0
b039040370950fe61e1c6ae5d5cf6650db9652f
});
})
});
}
console
.
log
(
`다음웹툰
${
daumCount
}
개, 네이버웹툰
${
naverCount
}
개`
)
});
}
<<<<<<<
HEAD
// 구현중
function
getTomicsToons
(){
}
// 구현중
// 설명
=======
// 모든 웹툰을 담고있는 배열
>>>>>>>
0
b039040370950fe61e1c6ae5d5cf6650db9652f
allWebtoons
=
new
Array
();
// 설명
...
...
Please
register
or
login
to post a comment