윤준현

gg

gg
Showing 1 changed file with 0 additions and 165 deletions
1 -var webcrawl = require('./crawling/Reol');
2 -var async = require('async');
3 -
4 -function jpSinger(msg, send){
5 - var discography;
6 - var task = [
7 - function(callback){
8 - webcrawl.crawl_Reol('https://namu.wiki/w/%EB%A0%88%EC%98%A4%EB%A3%A8/%EC%9D%8C%EB%B0%98#toc').then(function(Result){
9 - callback(null,Result)}).catch(function(err){});
10 - },
11 - function(discography, callback){
12 - console.log(discography);
13 -
14 - switch(msg){
15 - case 'Reol' :
16 - send = {
17 - 'message' : {
18 - 'text' : '이름 : Reol(れをる) \n성별 : 여성 \n생년월일 : 1993년 11월 9일 \n혈액형 : AB형',
19 - 'photo' : {
20 - 'url' : 'https://www.reol.jp/images/profile/reol_Aphoto_2.png',
21 - 'width' : 1000,
22 - 'height' : 667
23 - },
24 - 'message_button' : {
25 - 'label' : '공식 홈페이지',
26 - 'url' : "https://www.reol.jp/"
27 - }
28 - },
29 - keyboard : {
30 - 'type' : 'buttons',
31 - 'buttons' : ['Reol-Discography']
32 - }
33 - };
34 - break;
35 - case 'Reol-Discography' :
36 - console.log(discography);
37 - send = {
38 - 'message': {
39 - 'text': '앨범 목록입니다.'
40 - },
41 - keyboard: {
42 - 'type': 'buttons',
43 - 'buttons': ['a']
44 - }
45 - }
46 - break;
47 - case '米津玄師' :
48 - send = {
49 - 'message' : {
50 - 'text' : '이름 : 米津玄師(Yonezu Kenshi) \n 성별 : 남성 \n생년월일 : 1991년 3월 10일 \n혈액형 : O형',
51 - 'photo' : {
52 - 'url' : 'http://reissuerecords.net/rr/wp-content/uploads/flamingo_photo2.jpg',
53 - 'width' : 1000,
54 - 'height' : 667
55 - },
56 - 'message_button' : {
57 - 'label' : '공식 홈페이지',
58 - 'url' : "http://reissuerecords.net/"
59 - }
60 - },
61 - keyboard : {
62 - 'type' : 'buttons',
63 - 'buttons' : ['米津玄師-Discography']
64 - }
65 - };
66 - break;
67 - case '米津玄師-Discography' :
68 - send = {
69 - 'message' : {
70 - 'text' : 'Album List'
71 - },
72 - keyboard : {
73 - 'type' : 'buttons',
74 - 'buttons' : ['Reol', '米津玄師', 'yanaginagi', 'ヨルシカ', 'ダズビ', 'Polkadot Stingray', 'Aimyong']
75 - }
76 -
77 - };
78 - break;
79 - default:
80 - break;
81 - }
82 - callback(null,send);
83 - }
84 - ];
85 - async.waterfall(task, function(err, result){
86 - console.log(result, send);
87 - });
88 -
89 - return send;
90 -}
91 -
92 -
93 -function krSinger(msg){
94 - var send = {};
95 - switch(msg){
96 - case '볼빨간사춘기' :
97 - send = {
98 - 'message' : {
99 - 'text' : 'Reol',
100 - 'photo' : {
101 - 'url' : 'https://www.reol.jp/images/profile/reol_Aphoto_2.png',
102 - 'width' : 1000,
103 - 'height' : 667
104 - },
105 - 'message_button' : {
106 - 'label' : '공식 홈페이지',
107 - 'url' : "https://www.reol.jp/"
108 - },
109 - },
110 - keyboard : {
111 - 'type' : 'buttons',
112 - 'buttons' : ['Reol-Discography', 'Reol-Profile']
113 - }
114 - };
115 - break;
116 - case 'Reol-Discography' :
117 - send = {
118 - 'message' : {
119 - 'text' : 'Album List.'
120 - },
121 - keyboard : {
122 - 'type' : 'buttons',
123 - 'buttons' : ['Reol', '米津玄師', 'yanaginagi', 'ヨルシカ', 'ダズビ', 'Polkadot Stingray', 'Aimyong']
124 - }
125 -
126 - };
127 - break;
128 - case '米津玄師' :
129 - send = {
130 - 'message' : {
131 - 'text' : '米津玄師',
132 - 'photo' : {
133 - 'url' : 'https://www.reol.jp/images/profile/reol_Aphoto_2.png',
134 - 'width' : 1000,
135 - 'height' : 667
136 - },
137 - 'message_button' : {
138 - 'label' : '공식 홈페이지',
139 - 'url' : "https://www.reol.jp/"
140 - }
141 - },
142 - keyboard : {
143 - 'type' : 'buttons',
144 - 'buttons' : ['Reol-Discography','Reol-Profile']
145 - }
146 - };
147 - break;
148 - default:
149 - send = {
150 - 'message' : {
151 - 'text' : '등록되지 않은 가수입니다.'
152 - },
153 - keyboard : {
154 - 'type' : 'buttons',
155 - 'buttons' : ['한국', '일본']
156 - }
157 - }
158 - break;
159 - }
160 -
161 - return send;
162 -}
163 -
164 -exports.jpSinger = jpSinger;
165 -exports.krSinger = krSinger;
...\ No newline at end of file ...\ No newline at end of file