윤준현

add yorusika

success
......@@ -62,83 +62,4 @@ function crawl_Reol(url,callback){
});
}
exports.crawl_Reol = crawl_Reol;
// promise
// var request = require('request');
// var cheerio = require('cheerio');
// function crawl_Reol(url){
// return new Promise(function(resolve, reject){
// request(url, function (err, res, body) {
// const $ = cheerio.load(body);
// var Reol = new Array();
// var album, year
// var album_track = new Array();
// var json_album = new Array(), json_year = new Array(), json_track = new Array();
// $('body > div.content-wrapper > article > div.wiki-content.clearfix > div').each(function (index, ele) {
// for (var i = 1; i <= $('.toc-item').length; i++) {
// album = $(this).find('#toc > div > div:nth-child(2) > span:nth-child(' + i + ')').text() //앨범 정보 가져오기
// if (album != '') {
// json_album.push(album.substr(2));
// }
// var index = 7 + (i * 2); //트랙, 연도 가져오기 인덱스 변수
// if (index != 25) { //규칙성이 어긋나는 부분을 예외처리를 위해 if문
// //year 가져오기
// year = $('body > div.content-wrapper > article > div.wiki-content.clearfix > div > div:nth-child(' + index + ') > div:nth-child(3) > table > tbody > tr:nth-child(1) > td:nth-child(2)').text();
// //track 가져오기
// $('body > div.content-wrapper > article > div.wiki-content.clearfix > div > div:nth-child(' + index + ') > div:nth-child(3) > table > tbody').find('tr').each(function (index, ele) {
// var track = $(this).children().eq(1).text();
// if (track != '1' && track != '곡명' && track[4] != '년')
// album_track.push(track)
// });
// }
// else {
// year = $('body > div.content-wrapper > article > div.wiki-content.clearfix > div > div:nth-child(' + index + ') > div:nth-child(4) > table > tbody > tr:nth-child(1) > td:nth-child(2)').text();
// $('body > div.content-wrapper > article > div.wiki-content.clearfix > div > div:nth-child(' + index + ') > div:nth-child(4) > table > tbody').find('tr').each(function (index, ele) {
// var track = $(this).children().eq(1).text();
// if (track != '1' && track != '곡명' && track[4] != '년')
// album_track.push(track)
// });
// }
// if (year != '') {
// json_year.push(year);
// json_track.push(album_track);
// }
// album_track = [];
// }
// });
// Reol.push({ json_album, json_year, json_track });
// if (Reol) {
// resolve(Reol);
// }
// reject(new Error("Request is failed"));
// });
// });
// }
// exports.crawl_Reol = crawl_Reol;
\ No newline at end of file
exports.crawl_Reol = crawl_Reol;
\ No newline at end of file
......