Showing
9 changed files
with
345 additions
and
0 deletions
.gitignore
0 → 100644
backend/DBUpdate/main.js
0 → 100644
1 | +const mysql = require("mysql"); | ||
2 | +const khuuniv = require('./site_modules/KHU') | ||
3 | +const swuniv = require('./site_modules/swuniv') | ||
4 | +const janghak1 = require("./site_modules/janghak1") | ||
5 | +const janghak2 = require("./site_modules/janghak2") | ||
6 | + | ||
7 | +async function loading(){ | ||
8 | + li = await swuniv.loading(); | ||
9 | + for(var i = 0; i < li.length;i++){ | ||
10 | + await insertNotice(li[i]); | ||
11 | + } | ||
12 | + li = await khuuniv.loading(); | ||
13 | + for(var i = 0; i < li.length;i++){ | ||
14 | + await insertNotice(li[i]); | ||
15 | + } | ||
16 | + li = await janghak1.loading(); | ||
17 | + for(var i = 0; i < li.length;i++){ | ||
18 | + await insertNotice(li[i]); | ||
19 | + } | ||
20 | + li = await janghak2.loading(); | ||
21 | + for(var i = 0; i < li.length;i++){ | ||
22 | + await insertNotice(li[i]); | ||
23 | + } | ||
24 | +} | ||
25 | + | ||
26 | +var connection = mysql.createConnection({ | ||
27 | + host: "34.64.183.182", | ||
28 | + user: 'root', | ||
29 | + password: '', | ||
30 | + database: 'KhuNotice' | ||
31 | +}) | ||
32 | + | ||
33 | +connection.connect(); | ||
34 | + | ||
35 | +async function insertNotice(singleNotice){ | ||
36 | + date = singleNotice.date; | ||
37 | + title = singleNotice.title; | ||
38 | + link = singleNotice.link; | ||
39 | + site = singleNotice.site; | ||
40 | + | ||
41 | + await connection.query(`insert into noticeList (date, title, link, site) values('${date}','${title}','${link}','${site}')`,function(err){}); | ||
42 | + | ||
43 | +} | ||
44 | + | ||
45 | + | ||
46 | +module.exports.loading = loading; | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
backend/DBUpdate/site_modules/KHU.js
0 → 100644
1 | +const axios = require("axios"); | ||
2 | +const cheerio = require("cheerio"); | ||
3 | + | ||
4 | +var getHTML = async function(link){ | ||
5 | + try{ | ||
6 | + return await axios.get(link); | ||
7 | + } catch(e){ | ||
8 | + console.log(e); | ||
9 | + } | ||
10 | +} | ||
11 | + | ||
12 | +async function getList(link){ | ||
13 | + list = []; | ||
14 | + HTML = await getHTML(link); | ||
15 | + var $ = cheerio.load(HTML.data); | ||
16 | + var titleList = $('tr'); | ||
17 | + titleList.each(function(i, elem){ | ||
18 | + list[i] = { | ||
19 | + title: $(this).find(".txt06").text().replace(/(\r\n\t|\n|\r\t)/gm,"").replace(/(^\s*)|(\s*$)/gi, ""), | ||
20 | + link: "https://www.khu.ac.kr/kor/notice/"+$(this).find("a").attr('href'), | ||
21 | + date: $(this).find(".col04").text().replace(/(\r\n\t|\n|\r\t)/gm,"").replace(/(^\s*)|(\s*$)/gi, ""), | ||
22 | + site: '경희대학교 공지사항' | ||
23 | + } | ||
24 | + }) | ||
25 | + list = list.filter(item => item.title); | ||
26 | + return list | ||
27 | +} | ||
28 | + | ||
29 | +async function loading(){ | ||
30 | + li = await getList('https://www.khu.ac.kr/kor/notice/list.do?category=GENERAL&page=1'); | ||
31 | + return li; | ||
32 | +} | ||
33 | + | ||
34 | +module.exports.loading = loading; | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
backend/DBUpdate/site_modules/janghak1.js
0 → 100644
1 | +const axios = require("axios"); | ||
2 | +const cheerio = require("cheerio"); | ||
3 | +const Iconv = require("iconv").Iconv; | ||
4 | +var iconv = new Iconv('euc-kr', 'UTF-8//translit//ignore'); | ||
5 | + | ||
6 | +var getHTML = async function(link){ | ||
7 | + try{ | ||
8 | + return await axios.request({ | ||
9 | + method: 'GET', | ||
10 | + url: link, | ||
11 | + responseType: "arraybuffer", | ||
12 | + responseEncoding: "binary" | ||
13 | + }) | ||
14 | + } catch(e){ | ||
15 | + console.log(e); | ||
16 | + } | ||
17 | +} | ||
18 | + | ||
19 | +async function getList(link){ | ||
20 | + list = []; | ||
21 | + HTML = await getHTML(link); | ||
22 | + body = iconv.convert(HTML.data); | ||
23 | + var $ = cheerio.load(body); | ||
24 | + var titleList = $('.bg1'); | ||
25 | + titleList.each(function(i, elem){ | ||
26 | + list[i] = { | ||
27 | + title: $(this).find(".subject").text().replace(/(\r\n\t|\n|\r\t)/gm,"").replace(/(^\s*)|(\s*$)/gi, ""), | ||
28 | + link: "http://janghak.khu.ac.kr/board" + $(this).find("a").attr('href').substr(2), | ||
29 | + date: $(this).find(".datetime").text().replace(/(\r\n\t|\n|\r\t)/gm,"").replace(/(^\s*)|(\s*$)/gi, ""), | ||
30 | + site: '경희대학교 장학센터' | ||
31 | + } | ||
32 | + }) | ||
33 | + list = list.filter(item => item.title); | ||
34 | + return list | ||
35 | +} | ||
36 | + | ||
37 | +async function loading(){ | ||
38 | + li = await getList('http://janghak.khu.ac.kr/board/bbs/board.php?bo_table=06_01'); | ||
39 | + return li; | ||
40 | +} | ||
41 | + | ||
42 | +module.exports.loading = loading; | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
backend/DBUpdate/site_modules/janghak2.js
0 → 100644
1 | +const axios = require("axios"); | ||
2 | +const cheerio = require("cheerio"); | ||
3 | +const Iconv = require("iconv").Iconv; | ||
4 | +var iconv = new Iconv('euc-kr', 'UTF-8//translit//ignore'); | ||
5 | + | ||
6 | +var getHTML = async function(link){ | ||
7 | + try{ | ||
8 | + return await axios.request({ | ||
9 | + method: 'GET', | ||
10 | + url: link, | ||
11 | + responseType: "arraybuffer", | ||
12 | + responseEncoding: "binary" | ||
13 | + }) | ||
14 | + } catch(e){ | ||
15 | + console.log(e); | ||
16 | + } | ||
17 | +} | ||
18 | + | ||
19 | +async function getList(link){ | ||
20 | + list = []; | ||
21 | + HTML = await getHTML(link); | ||
22 | + body = iconv.convert(HTML.data); | ||
23 | + var $ = cheerio.load(body); | ||
24 | + var titleList = $('.bg2'); | ||
25 | + titleList.each(function(i, elem){ | ||
26 | + list[i] = { | ||
27 | + title: $(this).find(".subject").text().replace(/(\r\n\t|\n|\r\t)/gm,"").replace(/(^\s*)|(\s*$)/gi, ""), | ||
28 | + link: "http://janghak.khu.ac.kr/board" + $(this).find("a").attr('href').substr(2), | ||
29 | + date: $(this).find(".datetime").text().replace(/(\r\n\t|\n|\r\t)/gm,"").replace(/(^\s*)|(\s*$)/gi, ""), | ||
30 | + site: '경희대학교 장학센터' | ||
31 | + } | ||
32 | + }) | ||
33 | + list = list.filter(item => item.title); | ||
34 | + return list | ||
35 | +} | ||
36 | + | ||
37 | +async function loading(){ | ||
38 | + li = await getList('http://janghak.khu.ac.kr/board/bbs/board.php?bo_table=06_01'); | ||
39 | + return li; | ||
40 | +} | ||
41 | + | ||
42 | +module.exports.loading = loading; | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
backend/DBUpdate/site_modules/swuniv.js
0 → 100644
1 | +const axios = require("axios"); | ||
2 | +const cheerio = require("cheerio"); | ||
3 | + | ||
4 | +var getHTML = async function(link){ | ||
5 | + try{ | ||
6 | + return await axios.get(link); | ||
7 | + } catch(e){ | ||
8 | + console.log(e); | ||
9 | + } | ||
10 | +} | ||
11 | + | ||
12 | +async function getList(link){ | ||
13 | + list = []; | ||
14 | + HTML = await getHTML(link); | ||
15 | + var $ = cheerio.load(HTML.data); | ||
16 | + var titleList = $('tr'); | ||
17 | + titleList.each(function(i, elem){ | ||
18 | + list[i] = { | ||
19 | + title: $(this).find(".bo_tit").text().replace(/(\r\n\t|\n|\r\t)/gm,"").replace(/(^\s*)|(\s*$)/gi, ""), | ||
20 | + link: $(this).find("a").attr('href').replace(/(\r\n\t|\n|\r\t)/gm,"").replace(/(^\s*)|(\s*$)/gi, ""), | ||
21 | + date: $(this).find(".td_datetime").text().replace(/(\r\n\t|\n|\r\t)/gm,"").replace(/(^\s*)|(\s*$)/gi, ""), | ||
22 | + site: '소프트웨어 융합대학 공지사항' | ||
23 | + } | ||
24 | + }) | ||
25 | + list = list.filter(item => item.title); | ||
26 | + return list | ||
27 | +} | ||
28 | + | ||
29 | +async function loading(){ | ||
30 | + li = await getList('http://software.khu.ac.kr/board5/bbs/board.php?bo_table=05_01&page=1'); | ||
31 | + return li; | ||
32 | +} | ||
33 | + | ||
34 | +module.exports.loading = loading; |
... | @@ -17,6 +17,11 @@ | ... | @@ -17,6 +17,11 @@ |
17 | "defer-to-connect": "^1.0.1" | 17 | "defer-to-connect": "^1.0.1" |
18 | } | 18 | } |
19 | }, | 19 | }, |
20 | + "@types/node": { | ||
21 | + "version": "14.14.7", | ||
22 | + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.7.tgz", | ||
23 | + "integrity": "sha512-Zw1vhUSQZYw+7u5dAwNbIA9TuTotpzY/OF7sJM9FqPOF3SPjKnxrjoTktXDZgUjybf4cWVBP7O8wvKdSaGHweg==" | ||
24 | + }, | ||
20 | "abbrev": { | 25 | "abbrev": { |
21 | "version": "1.1.1", | 26 | "version": "1.1.1", |
22 | "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", | 27 | "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", |
... | @@ -78,6 +83,14 @@ | ... | @@ -78,6 +83,14 @@ |
78 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", | 83 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", |
79 | "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" | 84 | "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" |
80 | }, | 85 | }, |
86 | + "axios": { | ||
87 | + "version": "0.21.0", | ||
88 | + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.0.tgz", | ||
89 | + "integrity": "sha512-fmkJBknJKoZwem3/IKSSLpkdNXZeBu5Q7GA/aRsr2btgrptmSCxi2oFjZHqGdK9DoTil9PIHlPIZw2EcRJXRvw==", | ||
90 | + "requires": { | ||
91 | + "follow-redirects": "^1.10.0" | ||
92 | + } | ||
93 | + }, | ||
81 | "balanced-match": { | 94 | "balanced-match": { |
82 | "version": "1.0.0", | 95 | "version": "1.0.0", |
83 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", | 96 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", |
... | @@ -110,6 +123,11 @@ | ... | @@ -110,6 +123,11 @@ |
110 | "type-is": "~1.6.17" | 123 | "type-is": "~1.6.17" |
111 | } | 124 | } |
112 | }, | 125 | }, |
126 | + "boolbase": { | ||
127 | + "version": "1.0.0", | ||
128 | + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", | ||
129 | + "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=" | ||
130 | + }, | ||
113 | "boxen": { | 131 | "boxen": { |
114 | "version": "4.2.0", | 132 | "version": "4.2.0", |
115 | "resolved": "https://registry.npmjs.org/boxen/-/boxen-4.2.0.tgz", | 133 | "resolved": "https://registry.npmjs.org/boxen/-/boxen-4.2.0.tgz", |
... | @@ -205,6 +223,19 @@ | ... | @@ -205,6 +223,19 @@ |
205 | } | 223 | } |
206 | } | 224 | } |
207 | }, | 225 | }, |
226 | + "cheerio": { | ||
227 | + "version": "1.0.0-rc.3", | ||
228 | + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.3.tgz", | ||
229 | + "integrity": "sha512-0td5ijfUPuubwLUu0OBoe98gZj8C/AA+RW3v67GPlGOrvxWjZmBXiBCRU+I8VEiNyJzjth40POfHiz2RB3gImA==", | ||
230 | + "requires": { | ||
231 | + "css-select": "~1.2.0", | ||
232 | + "dom-serializer": "~0.1.1", | ||
233 | + "entities": "~1.1.1", | ||
234 | + "htmlparser2": "^3.9.1", | ||
235 | + "lodash": "^4.15.0", | ||
236 | + "parse5": "^3.0.1" | ||
237 | + } | ||
238 | + }, | ||
208 | "chokidar": { | 239 | "chokidar": { |
209 | "version": "3.4.3", | 240 | "version": "3.4.3", |
210 | "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.3.tgz", | 241 | "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.3.tgz", |
... | @@ -307,6 +338,22 @@ | ... | @@ -307,6 +338,22 @@ |
307 | "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", | 338 | "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", |
308 | "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==" | 339 | "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==" |
309 | }, | 340 | }, |
341 | + "css-select": { | ||
342 | + "version": "1.2.0", | ||
343 | + "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", | ||
344 | + "integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=", | ||
345 | + "requires": { | ||
346 | + "boolbase": "~1.0.0", | ||
347 | + "css-what": "2.1", | ||
348 | + "domutils": "1.5.1", | ||
349 | + "nth-check": "~1.0.1" | ||
350 | + } | ||
351 | + }, | ||
352 | + "css-what": { | ||
353 | + "version": "2.1.3", | ||
354 | + "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.3.tgz", | ||
355 | + "integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==" | ||
356 | + }, | ||
310 | "debug": { | 357 | "debug": { |
311 | "version": "2.6.9", | 358 | "version": "2.6.9", |
312 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", | 359 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", |
... | @@ -343,6 +390,37 @@ | ... | @@ -343,6 +390,37 @@ |
343 | "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", | 390 | "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", |
344 | "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" | 391 | "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" |
345 | }, | 392 | }, |
393 | + "dom-serializer": { | ||
394 | + "version": "0.1.1", | ||
395 | + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz", | ||
396 | + "integrity": "sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==", | ||
397 | + "requires": { | ||
398 | + "domelementtype": "^1.3.0", | ||
399 | + "entities": "^1.1.1" | ||
400 | + } | ||
401 | + }, | ||
402 | + "domelementtype": { | ||
403 | + "version": "1.3.1", | ||
404 | + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", | ||
405 | + "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==" | ||
406 | + }, | ||
407 | + "domhandler": { | ||
408 | + "version": "2.4.2", | ||
409 | + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz", | ||
410 | + "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==", | ||
411 | + "requires": { | ||
412 | + "domelementtype": "1" | ||
413 | + } | ||
414 | + }, | ||
415 | + "domutils": { | ||
416 | + "version": "1.5.1", | ||
417 | + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", | ||
418 | + "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", | ||
419 | + "requires": { | ||
420 | + "dom-serializer": "0", | ||
421 | + "domelementtype": "1" | ||
422 | + } | ||
423 | + }, | ||
346 | "dot-prop": { | 424 | "dot-prop": { |
347 | "version": "5.3.0", | 425 | "version": "5.3.0", |
348 | "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", | 426 | "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", |
... | @@ -379,6 +457,11 @@ | ... | @@ -379,6 +457,11 @@ |
379 | "once": "^1.4.0" | 457 | "once": "^1.4.0" |
380 | } | 458 | } |
381 | }, | 459 | }, |
460 | + "entities": { | ||
461 | + "version": "1.1.2", | ||
462 | + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", | ||
463 | + "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==" | ||
464 | + }, | ||
382 | "escape-goat": { | 465 | "escape-goat": { |
383 | "version": "2.1.1", | 466 | "version": "2.1.1", |
384 | "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz", | 467 | "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz", |
... | @@ -453,6 +536,11 @@ | ... | @@ -453,6 +536,11 @@ |
453 | "unpipe": "~1.0.0" | 536 | "unpipe": "~1.0.0" |
454 | } | 537 | } |
455 | }, | 538 | }, |
539 | + "follow-redirects": { | ||
540 | + "version": "1.13.0", | ||
541 | + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.0.tgz", | ||
542 | + "integrity": "sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA==" | ||
543 | + }, | ||
456 | "forwarded": { | 544 | "forwarded": { |
457 | "version": "0.1.2", | 545 | "version": "0.1.2", |
458 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", | 546 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", |
... | @@ -526,6 +614,31 @@ | ... | @@ -526,6 +614,31 @@ |
526 | "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz", | 614 | "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz", |
527 | "integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==" | 615 | "integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==" |
528 | }, | 616 | }, |
617 | + "htmlparser2": { | ||
618 | + "version": "3.10.1", | ||
619 | + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz", | ||
620 | + "integrity": "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==", | ||
621 | + "requires": { | ||
622 | + "domelementtype": "^1.3.1", | ||
623 | + "domhandler": "^2.3.0", | ||
624 | + "domutils": "^1.5.1", | ||
625 | + "entities": "^1.1.1", | ||
626 | + "inherits": "^2.0.1", | ||
627 | + "readable-stream": "^3.1.1" | ||
628 | + }, | ||
629 | + "dependencies": { | ||
630 | + "readable-stream": { | ||
631 | + "version": "3.6.0", | ||
632 | + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", | ||
633 | + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", | ||
634 | + "requires": { | ||
635 | + "inherits": "^2.0.3", | ||
636 | + "string_decoder": "^1.1.1", | ||
637 | + "util-deprecate": "^1.0.1" | ||
638 | + } | ||
639 | + } | ||
640 | + } | ||
641 | + }, | ||
529 | "http-cache-semantics": { | 642 | "http-cache-semantics": { |
530 | "version": "4.1.0", | 643 | "version": "4.1.0", |
531 | "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", | 644 | "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", |
... | @@ -543,6 +656,11 @@ | ... | @@ -543,6 +656,11 @@ |
543 | "toidentifier": "1.0.0" | 656 | "toidentifier": "1.0.0" |
544 | } | 657 | } |
545 | }, | 658 | }, |
659 | + "iconv": { | ||
660 | + "version": "3.0.0", | ||
661 | + "resolved": "https://registry.npmjs.org/iconv/-/iconv-3.0.0.tgz", | ||
662 | + "integrity": "sha512-bKTEP55J/e+UutBE3BDBWq6KukPWh3GBYCZGbLEY9vxRDUU2F3bqvPsp/a/DEdIamgF2MvW5lF0Rj1U/7KRL+g==" | ||
663 | + }, | ||
546 | "iconv-lite": { | 664 | "iconv-lite": { |
547 | "version": "0.4.24", | 665 | "version": "0.4.24", |
548 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", | 666 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", |
... | @@ -680,6 +798,11 @@ | ... | @@ -680,6 +798,11 @@ |
680 | "package-json": "^6.3.0" | 798 | "package-json": "^6.3.0" |
681 | } | 799 | } |
682 | }, | 800 | }, |
801 | + "lodash": { | ||
802 | + "version": "4.17.20", | ||
803 | + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", | ||
804 | + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" | ||
805 | + }, | ||
683 | "lowercase-keys": { | 806 | "lowercase-keys": { |
684 | "version": "1.0.1", | 807 | "version": "1.0.1", |
685 | "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", | 808 | "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", |
... | @@ -822,6 +945,14 @@ | ... | @@ -822,6 +945,14 @@ |
822 | "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", | 945 | "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", |
823 | "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==" | 946 | "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==" |
824 | }, | 947 | }, |
948 | + "nth-check": { | ||
949 | + "version": "1.0.2", | ||
950 | + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz", | ||
951 | + "integrity": "sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==", | ||
952 | + "requires": { | ||
953 | + "boolbase": "~1.0.0" | ||
954 | + } | ||
955 | + }, | ||
825 | "on-finished": { | 956 | "on-finished": { |
826 | "version": "2.3.0", | 957 | "version": "2.3.0", |
827 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", | 958 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", |
... | @@ -861,6 +992,14 @@ | ... | @@ -861,6 +992,14 @@ |
861 | } | 992 | } |
862 | } | 993 | } |
863 | }, | 994 | }, |
995 | + "parse5": { | ||
996 | + "version": "3.0.3", | ||
997 | + "resolved": "https://registry.npmjs.org/parse5/-/parse5-3.0.3.tgz", | ||
998 | + "integrity": "sha512-rgO9Zg5LLLkfJF9E6CCmXlSE4UVceloys8JrFqCcHloC3usd/kJCyPDwH2SOlzix2j3xaP9sUX3e8+kvkuleAA==", | ||
999 | + "requires": { | ||
1000 | + "@types/node": "*" | ||
1001 | + } | ||
1002 | + }, | ||
864 | "parseurl": { | 1003 | "parseurl": { |
865 | "version": "1.3.3", | 1004 | "version": "1.3.3", |
866 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", | 1005 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", | ... | ... |
... | @@ -7,8 +7,11 @@ | ... | @@ -7,8 +7,11 @@ |
7 | }, | 7 | }, |
8 | "license": "MIT", | 8 | "license": "MIT", |
9 | "dependencies": { | 9 | "dependencies": { |
10 | + "axios": "^0.21.0", | ||
11 | + "cheerio": "^1.0.0-rc.3", | ||
10 | "crypto": "^1.0.1", | 12 | "crypto": "^1.0.1", |
11 | "express": "^4.17.1", | 13 | "express": "^4.17.1", |
14 | + "iconv": "^3.0.0", | ||
12 | "mysql": "^2.18.1", | 15 | "mysql": "^2.18.1", |
13 | "nodemon": "^2.0.6" | 16 | "nodemon": "^2.0.6" |
14 | }, | 17 | }, | ... | ... |
1 | const fs = require ('fs'); | 1 | const fs = require ('fs'); |
2 | +const DBUpdate = require('../DBUpdate/main'); | ||
2 | 3 | ||
3 | var root = function (req, res) { | 4 | var root = function (req, res) { |
5 | + DBUpdate.loading(); | ||
4 | fs.readFile('./public/index.html',function(data){ | 6 | fs.readFile('./public/index.html',function(data){ |
5 | res.send(data) | 7 | res.send(data) |
6 | }); | 8 | }); |
7 | } | 9 | } |
8 | 10 | ||
11 | + | ||
9 | module.exports = root; | 12 | module.exports = root; |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment