Showing
20 changed files
with
784 additions
and
319 deletions
DB_collect/AI.js
0 → 100644
1 | +const config = require('./config') | ||
2 | +const mongoose = require("mongoose"); | ||
3 | +const { range } = require("express/lib/request"); | ||
4 | +const xlsx = require("xlsx"); | ||
5 | + | ||
6 | +const excelFile = xlsx.readFile("./GuideLine/인공지능학과 권장이수 가이드라인.xlsx"); | ||
7 | + | ||
8 | +const sheetName = excelFile.SheetNames[0]; | ||
9 | +const firstSheet = excelFile.Sheets[sheetName]; | ||
10 | +const jsonData = xlsx.utils.sheet_to_json(firstSheet); | ||
11 | + | ||
12 | +var first_first = []; | ||
13 | +var first_second = []; | ||
14 | +var second_first = []; | ||
15 | +var second_second = []; | ||
16 | +var third_first = []; | ||
17 | +var third_second = []; | ||
18 | +var fourth_first = []; | ||
19 | +var fourth_second = []; | ||
20 | +var new_list = []; | ||
21 | +function jason_to_arry() { | ||
22 | + for (var data in jsonData) { | ||
23 | + first_first.push(jsonData[data]['1학년 1학기']); | ||
24 | + first_second.push(jsonData[data]['1학년 2학기']); | ||
25 | + second_first.push(jsonData[data]['2학년 1학기']); | ||
26 | + second_second.push(jsonData[data]['2학년 2학기']); | ||
27 | + third_first.push(jsonData[data]['3학년 1학기']); | ||
28 | + third_second.push(jsonData[data]['3학년 2학기']); | ||
29 | + fourth_first.push(jsonData[data]['4학년 1학기']); | ||
30 | + fourth_second.push(jsonData[data]['4학년 2학기']); | ||
31 | + } | ||
32 | +} | ||
33 | +function remove_null() { | ||
34 | + first_first = first_first.filter(function (item) { | ||
35 | + return item !== null && item !== undefined && item !== ''; | ||
36 | + }); | ||
37 | + first_second = first_second.filter(function (item) { | ||
38 | + return item !== null && item !== undefined && item !== ''; | ||
39 | + }); | ||
40 | + second_first = second_first.filter(function (item) { | ||
41 | + return item !== null && item !== undefined && item !== ''; | ||
42 | + }); | ||
43 | + second_second = second_second.filter(function (item) { | ||
44 | + return item !== null && item !== undefined && item !== ''; | ||
45 | + }); | ||
46 | + third_first = third_first.filter(function (item) { | ||
47 | + return item !== null && item !== undefined && item !== ''; | ||
48 | + }); | ||
49 | + third_second = third_second.filter(function (item) { | ||
50 | + return item !== null && item !== undefined && item !== ''; | ||
51 | + }); | ||
52 | + fourth_first = fourth_first.filter(function (item) { | ||
53 | + return item !== null && item !== undefined && item !== ''; | ||
54 | + }); | ||
55 | + fourth_second = fourth_second.filter(function (item) { | ||
56 | + return item !== null && item !== undefined && item !== ''; | ||
57 | + }); | ||
58 | + new_list.push(first_first); | ||
59 | + new_list.push(first_second) | ||
60 | + new_list.push(second_first) | ||
61 | + new_list.push(second_second); | ||
62 | + new_list.push(third_first) | ||
63 | + new_list.push(third_second); | ||
64 | + new_list.push(fourth_first); | ||
65 | + new_list.push(fourth_second); | ||
66 | +} | ||
67 | +jason_to_arry() | ||
68 | +remove_null() | ||
69 | + | ||
70 | + | ||
71 | +const connect = mongoose.connect(config.url, | ||
72 | + { | ||
73 | + useNewUrlParser: true, | ||
74 | + useUnifiedTopology: true, | ||
75 | + }) | ||
76 | + .then(() => console.log("DB : Succesfully Connected")) | ||
77 | + .catch((err) => console.log(err.message)); | ||
78 | + | ||
79 | + | ||
80 | +var express = require('express'); | ||
81 | + | ||
82 | +const { Subinfo } = require('./models/model'); | ||
83 | +var request = require('request'); | ||
84 | +var options = { | ||
85 | + 'method': 'GET', | ||
86 | + 'url': 'https://sugang.khu.ac.kr/core?attribute=lectListJson&lang=ko&loginYn=N&menu=1&p_major=A10628&p_year=2022&p_term=10&initYn=Y', | ||
87 | + 'headers': { | ||
88 | + 'Cookie': 'JSESSIONID=aHGSkYnn7ZmXH5Wgx8So3tatw4J7LyR5g98tqYffSUU7qPhC7FFjOaemFCb8UgU5.amV1c19kb21haW4vV0hfU3VnYW5nMQ==; WMONID=R84FN19dbP4' | ||
89 | + }, | ||
90 | + formData: { | ||
91 | + 'attribute': 'lectListJson', | ||
92 | + 'lang': 'ko', | ||
93 | + 'loginYn': 'N', | ||
94 | + 'menu': '1', | ||
95 | + 'p_major': 'A07308', | ||
96 | + 'p_year': '2022', | ||
97 | + 'p_term': '10', | ||
98 | + 'initYn': 'Y' | ||
99 | + } | ||
100 | +}; | ||
101 | +request(options, async function (error, response) { | ||
102 | + if (error) throw new Error(error); | ||
103 | + var jason = response.body | ||
104 | + var json = JSON.parse(jason) | ||
105 | + | ||
106 | + const data = {} | ||
107 | + | ||
108 | + for (var i in json["rows"]) { | ||
109 | + // console.log(json["rows"][i]) | ||
110 | + } | ||
111 | + | ||
112 | + var x = 0, y = 0; | ||
113 | + for (var i = 0; i < new_list.length; i++) { | ||
114 | + var z = '필수'; | ||
115 | + if (i % 2 == 0) { | ||
116 | + x++; | ||
117 | + } | ||
118 | + for (var j = 0; j < new_list[i].length; j++) { | ||
119 | + if (new_list[i][j] == '선택') { | ||
120 | + z = '선택'; | ||
121 | + continue; | ||
122 | + } | ||
123 | + if (i % 2 == 0) { | ||
124 | + y = 1; | ||
125 | + } else { | ||
126 | + y = 2; | ||
127 | + } | ||
128 | + var subinfo = new Subinfo({ | ||
129 | + campus: "국제", | ||
130 | + college: "소프트웨어융합대학", | ||
131 | + department: "인공지능학과", | ||
132 | + grade: x + "학년" + y + "학기", | ||
133 | + name: new_list[i][j], | ||
134 | + choice: z, | ||
135 | + }) | ||
136 | + subinfo.save((err, result) => { | ||
137 | + if (err) { | ||
138 | + return err; | ||
139 | + } else { | ||
140 | + // console.log(result); | ||
141 | + } | ||
142 | + }) | ||
143 | + } | ||
144 | + } | ||
145 | + for (var i in json["rows"]) { | ||
146 | + var obj = {}; | ||
147 | + obj['time'] = json["rows"][i]["timetable"]; | ||
148 | + obj['prof'] = json["rows"][i]["teach_na"]; | ||
149 | + obj['credit'] = json["rows"][i]["unit_num"]; | ||
150 | + obj['name'] = json["rows"][i]["subjt_name"]; | ||
151 | + await Subinfo.findOne({department: "인공지능학과", name:obj['name']}).then((sub)=>{ | ||
152 | + if(sub){ | ||
153 | + var body={ | ||
154 | + prof:obj['prof'], | ||
155 | + time:obj['time'] | ||
156 | + } | ||
157 | + sub.credit=obj['credit'] | ||
158 | + sub.subject.push(body); | ||
159 | + sub.save((err,result)=>{ | ||
160 | + if(err){ | ||
161 | + console.log(err) | ||
162 | + }else if(result){ | ||
163 | + //console.log(result); | ||
164 | + } | ||
165 | + }) | ||
166 | + } | ||
167 | + }) | ||
168 | + } | ||
169 | +}); | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
DB_collect/CSE.js
0 → 100644
1 | +const config = require('./config') | ||
2 | +const mongoose = require("mongoose"); | ||
3 | +const { range } = require("express/lib/request"); | ||
4 | +const xlsx = require("xlsx"); | ||
5 | + | ||
6 | +const excelFile = xlsx.readFile("./GuideLine/컴퓨터공학과 권장이수 가이드라인.xlsx"); | ||
7 | +const sheetName = excelFile.SheetNames[0]; | ||
8 | +const firstSheet = excelFile.Sheets[sheetName]; | ||
9 | +const jsonData = xlsx.utils.sheet_to_json(firstSheet); | ||
10 | + | ||
11 | +var first_first = []; | ||
12 | +var first_second = []; | ||
13 | +var second_first = []; | ||
14 | +var second_second = []; | ||
15 | +var third_first = []; | ||
16 | +var third_second = []; | ||
17 | +var fourth_first = []; | ||
18 | +var fourth_second = []; | ||
19 | +var new_list = []; | ||
20 | +function jason_to_arry() { | ||
21 | + for (var data in jsonData) { | ||
22 | + first_first.push(jsonData[data]['1학년 1학기']); | ||
23 | + first_second.push(jsonData[data]['1학년 2학기']); | ||
24 | + second_first.push(jsonData[data]['2학년 1학기']); | ||
25 | + second_second.push(jsonData[data]['2학년 2학기']); | ||
26 | + third_first.push(jsonData[data]['3학년 1학기']); | ||
27 | + third_second.push(jsonData[data]['3학년 2학기']); | ||
28 | + fourth_first.push(jsonData[data]['4학년 1학기']); | ||
29 | + fourth_second.push(jsonData[data]['4학년 2학기']); | ||
30 | + } | ||
31 | +} | ||
32 | +function remove_null() { | ||
33 | + first_first = first_first.filter(function (item) { | ||
34 | + return item !== null && item !== undefined && item !== ''; | ||
35 | + }); | ||
36 | + first_second = first_second.filter(function (item) { | ||
37 | + return item !== null && item !== undefined && item !== ''; | ||
38 | + }); | ||
39 | + second_first = second_first.filter(function (item) { | ||
40 | + return item !== null && item !== undefined && item !== ''; | ||
41 | + }); | ||
42 | + second_second = second_second.filter(function (item) { | ||
43 | + return item !== null && item !== undefined && item !== ''; | ||
44 | + }); | ||
45 | + third_first = third_first.filter(function (item) { | ||
46 | + return item !== null && item !== undefined && item !== ''; | ||
47 | + }); | ||
48 | + third_second = third_second.filter(function (item) { | ||
49 | + return item !== null && item !== undefined && item !== ''; | ||
50 | + }); | ||
51 | + fourth_first = fourth_first.filter(function (item) { | ||
52 | + return item !== null && item !== undefined && item !== ''; | ||
53 | + }); | ||
54 | + fourth_second = fourth_second.filter(function (item) { | ||
55 | + return item !== null && item !== undefined && item !== ''; | ||
56 | + }); | ||
57 | + new_list.push(first_first); | ||
58 | + new_list.push(first_second) | ||
59 | + new_list.push(second_first) | ||
60 | + new_list.push(second_second); | ||
61 | + new_list.push(third_first) | ||
62 | + new_list.push(third_second); | ||
63 | + new_list.push(fourth_first); | ||
64 | + new_list.push(fourth_second); | ||
65 | +} | ||
66 | +jason_to_arry() | ||
67 | +remove_null() | ||
68 | + | ||
69 | + | ||
70 | +const connect = mongoose.connect(config.url, | ||
71 | + { | ||
72 | + useNewUrlParser: true, | ||
73 | + useUnifiedTopology: true, | ||
74 | + }) | ||
75 | + .then(() => console.log("DB : Succesfully Connected")) | ||
76 | + .catch((err) => console.log(err.message)); | ||
77 | + | ||
78 | + | ||
79 | +var express = require('express'); | ||
80 | + | ||
81 | +const { Subinfo } = require('./models/model'); | ||
82 | +var request = require('request'); | ||
83 | +var options = { | ||
84 | + 'method': 'GET', | ||
85 | + 'url': 'https://sugang.khu.ac.kr/core?attribute=lectListJson&lang=ko&loginYn=N&menu=1&p_major=A10627&p_year=2022&p_term=10&initYn=Y', | ||
86 | + 'headers': { | ||
87 | + 'Cookie': 'JSESSIONID=aHGSkYnn7ZmXH5Wgx8So3tatw4J7LyR5g98tqYffSUU7qPhC7FFjOaemFCb8UgU5.amV1c19kb21haW4vV0hfU3VnYW5nMQ==; WMONID=R84FN19dbP4' | ||
88 | + }, | ||
89 | + formData: { | ||
90 | + 'attribute': 'lectListJson', | ||
91 | + 'lang': 'ko', | ||
92 | + 'loginYn': 'N', | ||
93 | + 'menu': '1', | ||
94 | + 'p_major': 'A07308', | ||
95 | + 'p_year': '2022', | ||
96 | + 'p_term': '10', | ||
97 | + 'initYn': 'Y' | ||
98 | + } | ||
99 | +}; | ||
100 | +request(options, async function (error, response) { | ||
101 | + if (error) throw new Error(error); | ||
102 | + var jason = response.body | ||
103 | + var json = JSON.parse(jason) | ||
104 | + | ||
105 | + const data = {} | ||
106 | + | ||
107 | + for (var i in json["rows"]) { | ||
108 | + // console.log(json["rows"][i]) | ||
109 | + } | ||
110 | + | ||
111 | + var x = 0, y = 0; | ||
112 | + for (var i = 0; i < new_list.length; i++) { | ||
113 | + var z = '필수'; | ||
114 | + if (i % 2 == 0) { | ||
115 | + x++; | ||
116 | + } | ||
117 | + for (var j = 0; j < new_list[i].length; j++) { | ||
118 | + if (new_list[i][j] == '선택') { | ||
119 | + z = '선택'; | ||
120 | + continue; | ||
121 | + } | ||
122 | + if (i % 2 == 0) { | ||
123 | + y = 1; | ||
124 | + } else { | ||
125 | + y = 2; | ||
126 | + } | ||
127 | + var subinfo = new Subinfo({ | ||
128 | + campus: "국제", | ||
129 | + college: "소프트웨어융합대학", | ||
130 | + department: "컴퓨터공학과", | ||
131 | + grade: x + "학년" + y + "학기", | ||
132 | + name: new_list[i][j], | ||
133 | + choice: z, | ||
134 | + }) | ||
135 | + subinfo.save((err, result) => { | ||
136 | + if (err) { | ||
137 | + return err; | ||
138 | + } else { | ||
139 | + // console.log(result); | ||
140 | + } | ||
141 | + }) | ||
142 | + } | ||
143 | + } | ||
144 | + for (var i in json["rows"]) { | ||
145 | + var obj = {}; | ||
146 | + obj['time'] = json["rows"][i]["timetable"]; | ||
147 | + obj['prof'] = json["rows"][i]["teach_na"]; | ||
148 | + obj['credit'] = json["rows"][i]["unit_num"]; | ||
149 | + obj['name'] = json["rows"][i]["subjt_name"]; | ||
150 | + await Subinfo.findOne({department: "컴퓨터공학과", name:obj['name']}).then((sub)=>{ | ||
151 | + if(sub){ | ||
152 | + var body={ | ||
153 | + prof:obj['prof'], | ||
154 | + time:obj['time'] | ||
155 | + } | ||
156 | + sub.credit=obj['credit'] | ||
157 | + sub.subject.push(body); | ||
158 | + sub.save((err,result)=>{ | ||
159 | + if(err){ | ||
160 | + console.log(err) | ||
161 | + }else if(result){ | ||
162 | + //console.log(result); | ||
163 | + } | ||
164 | + }) | ||
165 | + } | ||
166 | + }) | ||
167 | + } | ||
168 | +}); | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
... | @@ -2,7 +2,12 @@ const config = require('./config') | ... | @@ -2,7 +2,12 @@ const config = require('./config') |
2 | const mongoose = require("mongoose"); | 2 | const mongoose = require("mongoose"); |
3 | const { range } = require("express/lib/request"); | 3 | const { range } = require("express/lib/request"); |
4 | const xlsx = require("xlsx"); | 4 | const xlsx = require("xlsx"); |
5 | -const fs = require('fs') | 5 | + |
6 | +const excelFile = xlsx.readFile("./GuideLine/소프트웨어융합학과_미래자동차.로봇 트랙 권장이수.xlsx"); | ||
7 | +const sheetName = excelFile.SheetNames[0]; | ||
8 | +const firstSheet = excelFile.Sheets[sheetName]; | ||
9 | +const jsonData = xlsx.utils.sheet_to_json(firstSheet); | ||
10 | + | ||
6 | var first_first = []; | 11 | var first_first = []; |
7 | var first_second = []; | 12 | var first_second = []; |
8 | var second_first = []; | 13 | var second_first = []; |
... | @@ -11,8 +16,8 @@ var third_first = []; | ... | @@ -11,8 +16,8 @@ var third_first = []; |
11 | var third_second = []; | 16 | var third_second = []; |
12 | var fourth_first = []; | 17 | var fourth_first = []; |
13 | var fourth_second = []; | 18 | var fourth_second = []; |
14 | -var new_list = {}; | 19 | +var new_list = []; |
15 | -function jason_to_arry(jsonData) { | 20 | +function jason_to_arry() { |
16 | for (var data in jsonData) { | 21 | for (var data in jsonData) { |
17 | first_first.push(jsonData[data]['1학년 1학기']); | 22 | first_first.push(jsonData[data]['1학년 1학기']); |
18 | first_second.push(jsonData[data]['1학년 2학기']); | 23 | first_second.push(jsonData[data]['1학년 2학기']); |
... | @@ -24,9 +29,8 @@ function jason_to_arry(jsonData) { | ... | @@ -24,9 +29,8 @@ function jason_to_arry(jsonData) { |
24 | fourth_second.push(jsonData[data]['4학년 2학기']); | 29 | fourth_second.push(jsonData[data]['4학년 2학기']); |
25 | } | 30 | } |
26 | } | 31 | } |
27 | -// json -> array로 변경 | 32 | +// jason -> array로 변경 |
28 | -function remove_null(major) { | 33 | +function remove_null() { |
29 | - | ||
30 | first_first = first_first.filter(function (item) { | 34 | first_first = first_first.filter(function (item) { |
31 | return item !== null && item !== undefined && item !== ''; | 35 | return item !== null && item !== undefined && item !== ''; |
32 | }); | 36 | }); |
... | @@ -51,40 +55,17 @@ function remove_null(major) { | ... | @@ -51,40 +55,17 @@ function remove_null(major) { |
51 | fourth_second = fourth_second.filter(function (item) { | 55 | fourth_second = fourth_second.filter(function (item) { |
52 | return item !== null && item !== undefined && item !== ''; | 56 | return item !== null && item !== undefined && item !== ''; |
53 | }); | 57 | }); |
54 | - new_list[major]=[first_first,first_second,second_first,second_second,third_first,third_second,fourth_first,fourth_second] | 58 | + new_list.push(first_first); |
55 | - // new_list.push(first_first); | 59 | + new_list.push(first_second) |
56 | - // new_list.push(first_second) | 60 | + new_list.push(second_first) |
57 | - // new_list.push(second_first) | 61 | + new_list.push(second_second); |
58 | - // new_list.push(second_second); | 62 | + new_list.push(third_first) |
59 | - // new_list.push(third_first) | 63 | + new_list.push(third_second); |
60 | - // new_list.push(third_second); | 64 | + new_list.push(fourth_first); |
61 | - // new_list.push(fourth_first); | 65 | + new_list.push(fourth_second); |
62 | - // new_list.push(fourth_second); | ||
63 | } | 66 | } |
64 | - | 67 | +jason_to_arry() |
65 | -fs.readdirSync("./GuideLine").forEach(file => { | 68 | +remove_null() |
66 | - // console.log(file); | ||
67 | - var major=file.split(' ')[0] | ||
68 | - console.log(major) | ||
69 | - const excelFile = xlsx.readFile(`./GuideLine/${file}`) | ||
70 | - const sheetName = excelFile.SheetNames[0]; | ||
71 | - const firstSheet = excelFile.Sheets[sheetName]; | ||
72 | - const jsonData = xlsx.utils.sheet_to_json(firstSheet) | ||
73 | - jason_to_arry(jsonData) | ||
74 | - remove_null(major) | ||
75 | - first_first = []; | ||
76 | - first_second = []; | ||
77 | - second_first = []; | ||
78 | - second_second = []; | ||
79 | - third_first = []; | ||
80 | - third_second = []; | ||
81 | - fourth_first = []; | ||
82 | - fourth_second = []; | ||
83 | -}); | ||
84 | -console.log(new_list['']) | ||
85 | -// const excelFile = xlsx.readFile("./GuideLine/컴퓨터공학과 권장이수 가이드라인.xlsx"); | ||
86 | -// null 값 제거 | ||
87 | - | ||
88 | 69 | ||
89 | 70 | ||
90 | const connect = mongoose.connect(config.url, | 71 | const connect = mongoose.connect(config.url, |
... | @@ -98,91 +79,91 @@ const connect = mongoose.connect(config.url, | ... | @@ -98,91 +79,91 @@ const connect = mongoose.connect(config.url, |
98 | 79 | ||
99 | var express = require('express'); | 80 | var express = require('express'); |
100 | 81 | ||
101 | -var major_list = ["A07337", "A10628", "A07308", "A10627"]; | ||
102 | const { Subinfo } = require('./models/model'); | 82 | const { Subinfo } = require('./models/model'); |
103 | var request = require('request'); | 83 | var request = require('request'); |
104 | -for (i in major_list) { | 84 | +var options = { |
105 | - var options = { | 85 | + 'method': 'GET', |
106 | - 'method': 'GET', | 86 | + 'url': 'https://sugang.khu.ac.kr/core?attribute=lectListJson&lang=ko&loginYn=N&menu=1&p_major=A07337&p_year=2022&p_term=10&initYn=Y', |
107 | - 'url': `https://sugang.khu.ac.kr/core?attribute=lectListJson&lang=ko&loginYn=N&menu=1&p_major=${i}&p_year=2022&p_term=10&initYn=Y`, | 87 | + 'headers': { |
108 | - 'headers': { | 88 | + 'Cookie': 'JSESSIONID=aHGSkYnn7ZmXH5Wgx8So3tatw4J7LyR5g98tqYffSUU7qPhC7FFjOaemFCb8UgU5.amV1c19kb21haW4vV0hfU3VnYW5nMQ==; WMONID=R84FN19dbP4' |
109 | - 'Cookie': 'JSESSIONID=aHGSkYnn7ZmXH5Wgx8So3tatw4J7LyR5g98tqYffSUU7qPhC7FFjOaemFCb8UgU5.amV1c19kb21haW4vV0hfU3VnYW5nMQ==; WMONID=R84FN19dbP4' | 89 | + }, |
110 | - }, | 90 | + formData: { |
111 | - formData: { | 91 | + 'attribute': 'lectListJson', |
112 | - 'attribute': 'lectListJson', | 92 | + 'lang': 'ko', |
113 | - 'lang': 'ko', | 93 | + 'loginYn': 'N', |
114 | - 'loginYn': 'N', | 94 | + 'menu': '1', |
115 | - 'menu': '1', | 95 | + 'p_major': 'A07308', |
116 | - 'p_major': 'A07308', | 96 | + 'p_year': '2022', |
117 | - 'p_year': '2022', | 97 | + 'p_term': '10', |
118 | - 'p_term': '10', | 98 | + 'initYn': 'Y' |
119 | - 'initYn': 'Y' | 99 | + } |
120 | - } | 100 | +}; |
121 | - }; | 101 | +request(options, async function (error, response) { |
122 | - request(options, async function (error, response) { | 102 | + if (error) throw new Error(error); |
123 | - if (error) throw new Error(error); | 103 | + var jason = response.body |
124 | - var jason = response.body | 104 | + var json = JSON.parse(jason) |
125 | - var json = JSON.parse(jason) | ||
126 | 105 | ||
127 | - const data = {} | 106 | + const data = {} |
128 | 107 | ||
108 | + for (var i in json["rows"]) { | ||
109 | + // console.log(json["rows"][i]) | ||
110 | + } | ||
129 | 111 | ||
130 | - var x = 0, y = 0; | 112 | + var x = 0, y = 0; |
113 | + for (var i = 0; i < new_list.length; i++) { | ||
131 | var z = '필수'; | 114 | var z = '필수'; |
132 | - for (var i = 0; i < new_list.length; i++) { | 115 | + if (i % 2 == 0) { |
116 | + x++; | ||
117 | + } | ||
118 | + for (var j = 0; j < new_list[i].length; j++) { | ||
119 | + if (new_list[i][j] == '선택') { | ||
120 | + z = '선택'; | ||
121 | + continue; | ||
122 | + } | ||
133 | if (i % 2 == 0) { | 123 | if (i % 2 == 0) { |
134 | - x++; | 124 | + y = 1; |
125 | + } else { | ||
126 | + y = 2; | ||
135 | } | 127 | } |
136 | - for (var j = 0; j < new_list[i].length; j++) { | 128 | + var subinfo = new Subinfo({ |
137 | - if (new_list[i][j] == '선택') { | 129 | + campus: "국제", |
138 | - z = '선택'; | 130 | + college: "소프트웨어융합대학", |
139 | - continue; | 131 | + department: "소프트웨어융합학과_미래자동차.로봇", |
140 | - } | 132 | + grade: x + "학년" + y + "학기", |
141 | - if (i % 2 == 0) { | 133 | + name: new_list[i][j], |
142 | - y = 1; | 134 | + choice: z, |
135 | + }) | ||
136 | + subinfo.save((err, result) => { | ||
137 | + if (err) { | ||
138 | + return err; | ||
143 | } else { | 139 | } else { |
144 | - y = 2; | 140 | + // console.log(result); |
145 | } | 141 | } |
146 | - var subinfo = new Subinfo({ | 142 | + }) |
147 | - campus: "국제", | 143 | + } |
148 | - college: "소프트웨어융합대학", | 144 | + } |
149 | - department: "컴퓨터공학과", | 145 | + for (var i in json["rows"]) { |
150 | - grade: x + "학년" + y + "학기", | 146 | + var obj = {}; |
151 | - name: new_list[i][j], | 147 | + obj['time'] = json["rows"][i]["timetable"]; |
152 | - choice: z | 148 | + obj['prof'] = json["rows"][i]["teach_na"]; |
153 | - }) | 149 | + obj['credit'] = json["rows"][i]["unit_num"]; |
154 | - subinfo.save((err, result) => { | 150 | + obj['name'] = json["rows"][i]["subjt_name"]; |
155 | - if (err) { | 151 | + await Subinfo.findOne({department: "소프트웨어융합학과_미래자동차.로봇", name:obj['name']}).then((sub)=>{ |
156 | - return err; | 152 | + if(sub){ |
157 | - } else { | 153 | + var body={ |
158 | - // console.log(result); | 154 | + prof:obj['prof'], |
155 | + time:obj['time'] | ||
156 | + } | ||
157 | + sub.credit=obj['credit'] | ||
158 | + sub.subject.push(body); | ||
159 | + sub.save((err,result)=>{ | ||
160 | + if(err){ | ||
161 | + console.log(err) | ||
162 | + }else if(result){ | ||
163 | + //console.log(result); | ||
159 | } | 164 | } |
160 | }) | 165 | }) |
161 | } | 166 | } |
162 | - } | ||
163 | - for (var i in json["rows"]) { | ||
164 | - var obj = {}; | ||
165 | - obj['time'] = json["rows"][i]["timetable"]; | ||
166 | - obj['prof'] = json["rows"][i]["teach_na"]; | ||
167 | - obj['credit'] = json["rows"][i]["unit_num"]; | ||
168 | - obj['name'] = json["rows"][i]["subjt_name"]; | ||
169 | - await Subinfo.findOne({ name: obj['name'] }).then((sub) => { | ||
170 | - if (sub) { | ||
171 | - var body = { | ||
172 | - prof: obj['prof'], | ||
173 | - time: obj['time'] | ||
174 | - } | ||
175 | - sub.credit = obj['credit'] | ||
176 | - sub.subject.push(body); | ||
177 | - sub.save((err, result) => { | ||
178 | - if (err) { | ||
179 | - console.log(err) | ||
180 | - } else if (result) { | ||
181 | - console.log(result); | ||
182 | - } | ||
183 | - }) | ||
184 | - } | ||
185 | - }) | ||
186 | - } | ||
187 | - }); | ||
188 | -}; | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
167 | + }) | ||
168 | + } | ||
169 | +}); | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
DB_collect/SWC_datascience.js
0 → 100644
1 | +const config = require('./config') | ||
2 | +const mongoose = require("mongoose"); | ||
3 | +const { range } = require("express/lib/request"); | ||
4 | +const xlsx = require("xlsx"); | ||
5 | + | ||
6 | +const excelFile = xlsx.readFile("./GuideLine/소프트웨어융합학과_데이터사이언스 트랙.xlsx"); | ||
7 | +const sheetName = excelFile.SheetNames[0]; | ||
8 | +const firstSheet = excelFile.Sheets[sheetName]; | ||
9 | +const jsonData = xlsx.utils.sheet_to_json(firstSheet); | ||
10 | + | ||
11 | +var first_first = []; | ||
12 | +var first_second = []; | ||
13 | +var second_first = []; | ||
14 | +var second_second = []; | ||
15 | +var third_first = []; | ||
16 | +var third_second = []; | ||
17 | +var fourth_first = []; | ||
18 | +var fourth_second = []; | ||
19 | +var new_list = []; | ||
20 | +function jason_to_arry() { | ||
21 | + for (var data in jsonData) { | ||
22 | + first_first.push(jsonData[data]['1학년 1학기']); | ||
23 | + first_second.push(jsonData[data]['1학년 2학기']); | ||
24 | + second_first.push(jsonData[data]['2학년 1학기']); | ||
25 | + second_second.push(jsonData[data]['2학년 2학기']); | ||
26 | + third_first.push(jsonData[data]['3학년 1학기']); | ||
27 | + third_second.push(jsonData[data]['3학년 2학기']); | ||
28 | + fourth_first.push(jsonData[data]['4학년 1학기']); | ||
29 | + fourth_second.push(jsonData[data]['4학년 2학기']); | ||
30 | + } | ||
31 | +} | ||
32 | +// jason -> array로 변경 | ||
33 | +function remove_null() { | ||
34 | + first_first = first_first.filter(function (item) { | ||
35 | + return item !== null && item !== undefined && item !== ''; | ||
36 | + }); | ||
37 | + first_second = first_second.filter(function (item) { | ||
38 | + return item !== null && item !== undefined && item !== ''; | ||
39 | + }); | ||
40 | + second_first = second_first.filter(function (item) { | ||
41 | + return item !== null && item !== undefined && item !== ''; | ||
42 | + }); | ||
43 | + second_second = second_second.filter(function (item) { | ||
44 | + return item !== null && item !== undefined && item !== ''; | ||
45 | + }); | ||
46 | + third_first = third_first.filter(function (item) { | ||
47 | + return item !== null && item !== undefined && item !== ''; | ||
48 | + }); | ||
49 | + third_second = third_second.filter(function (item) { | ||
50 | + return item !== null && item !== undefined && item !== ''; | ||
51 | + }); | ||
52 | + fourth_first = fourth_first.filter(function (item) { | ||
53 | + return item !== null && item !== undefined && item !== ''; | ||
54 | + }); | ||
55 | + fourth_second = fourth_second.filter(function (item) { | ||
56 | + return item !== null && item !== undefined && item !== ''; | ||
57 | + }); | ||
58 | + new_list.push(first_first); | ||
59 | + new_list.push(first_second) | ||
60 | + new_list.push(second_first) | ||
61 | + new_list.push(second_second); | ||
62 | + new_list.push(third_first) | ||
63 | + new_list.push(third_second); | ||
64 | + new_list.push(fourth_first); | ||
65 | + new_list.push(fourth_second); | ||
66 | +} | ||
67 | +jason_to_arry() | ||
68 | +remove_null() | ||
69 | + | ||
70 | + | ||
71 | +const connect = mongoose.connect(config.url, | ||
72 | + { | ||
73 | + useNewUrlParser: true, | ||
74 | + useUnifiedTopology: true, | ||
75 | + }) | ||
76 | + .then(() => console.log("DB : Succesfully Connected")) | ||
77 | + .catch((err) => console.log(err.message)); | ||
78 | + | ||
79 | + | ||
80 | +var express = require('express'); | ||
81 | + | ||
82 | +const { Subinfo } = require('./models/model'); | ||
83 | +var request = require('request'); | ||
84 | +var options = { | ||
85 | + 'method': 'GET', | ||
86 | + 'url': 'https://sugang.khu.ac.kr/core?attribute=lectListJson&lang=ko&loginYn=N&menu=1&p_major=A07337&p_year=2022&p_term=10&initYn=Y', | ||
87 | + 'headers': { | ||
88 | + 'Cookie': 'JSESSIONID=aHGSkYnn7ZmXH5Wgx8So3tatw4J7LyR5g98tqYffSUU7qPhC7FFjOaemFCb8UgU5.amV1c19kb21haW4vV0hfU3VnYW5nMQ==; WMONID=R84FN19dbP4' | ||
89 | + }, | ||
90 | + formData: { | ||
91 | + 'attribute': 'lectListJson', | ||
92 | + 'lang': 'ko', | ||
93 | + 'loginYn': 'N', | ||
94 | + 'menu': '1', | ||
95 | + 'p_major': 'A07308', | ||
96 | + 'p_year': '2022', | ||
97 | + 'p_term': '10', | ||
98 | + 'initYn': 'Y' | ||
99 | + } | ||
100 | +}; | ||
101 | +request(options, async function (error, response) { | ||
102 | + if (error) throw new Error(error); | ||
103 | + var jason = response.body | ||
104 | + var json = JSON.parse(jason) | ||
105 | + | ||
106 | + const data = {} | ||
107 | + | ||
108 | + for (var i in json["rows"]) { | ||
109 | + // console.log(json["rows"][i]) | ||
110 | + } | ||
111 | + | ||
112 | + var x = 0, y = 0; | ||
113 | + for (var i = 0; i < new_list.length; i++) { | ||
114 | + var z = '필수'; | ||
115 | + if (i % 2 == 0) { | ||
116 | + x++; | ||
117 | + } | ||
118 | + for (var j = 0; j < new_list[i].length; j++) { | ||
119 | + if (new_list[i][j] == '선택') { | ||
120 | + z = '선택'; | ||
121 | + continue; | ||
122 | + } | ||
123 | + if (i % 2 == 0) { | ||
124 | + y = 1; | ||
125 | + } else { | ||
126 | + y = 2; | ||
127 | + } | ||
128 | + var subinfo = new Subinfo({ | ||
129 | + campus: "국제", | ||
130 | + college: "소프트웨어융합대학", | ||
131 | + department: "소프트웨어융합학과_데이터사이언스", | ||
132 | + grade: x + "학년" + y + "학기", | ||
133 | + name: new_list[i][j], | ||
134 | + choice: z, | ||
135 | + }) | ||
136 | + subinfo.save((err, result) => { | ||
137 | + if (err) { | ||
138 | + return err; | ||
139 | + } else { | ||
140 | + // console.log(result); | ||
141 | + } | ||
142 | + }) | ||
143 | + } | ||
144 | + } | ||
145 | + for (var i in json["rows"]) { | ||
146 | + var obj = {}; | ||
147 | + obj['time'] = json["rows"][i]["timetable"]; | ||
148 | + obj['prof'] = json["rows"][i]["teach_na"]; | ||
149 | + obj['credit'] = json["rows"][i]["unit_num"]; | ||
150 | + obj['name'] = json["rows"][i]["subjt_name"]; | ||
151 | + await Subinfo.findOne({department: "소프트웨어융합학과_데이터사이언스", name:obj['name']}).then((sub)=>{ | ||
152 | + if(sub){ | ||
153 | + var body={ | ||
154 | + prof:obj['prof'], | ||
155 | + time:obj['time'] | ||
156 | + } | ||
157 | + sub.credit=obj['credit'] | ||
158 | + sub.subject.push(body); | ||
159 | + sub.save((err,result)=>{ | ||
160 | + if(err){ | ||
161 | + console.log(err) | ||
162 | + }else if(result){ | ||
163 | + //console.log(result); | ||
164 | + } | ||
165 | + }) | ||
166 | + } | ||
167 | + }) | ||
168 | + } | ||
169 | +}); | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
DB_collect/SWC_gamecontents.js
0 → 100644
1 | +const config = require('./config') | ||
2 | +const mongoose = require("mongoose"); | ||
3 | +const { range } = require("express/lib/request"); | ||
4 | +const xlsx = require("xlsx"); | ||
5 | + | ||
6 | +const excelFile = xlsx.readFile("./GuideLine/소프트웨어융합학과_게임콘텐츠 트랙.xlsx"); | ||
7 | +const sheetName = excelFile.SheetNames[0]; | ||
8 | +const firstSheet = excelFile.Sheets[sheetName]; | ||
9 | +const jsonData = xlsx.utils.sheet_to_json(firstSheet); | ||
10 | + | ||
11 | +var first_first = []; | ||
12 | +var first_second = []; | ||
13 | +var second_first = []; | ||
14 | +var second_second = []; | ||
15 | +var third_first = []; | ||
16 | +var third_second = []; | ||
17 | +var fourth_first = []; | ||
18 | +var fourth_second = []; | ||
19 | +var new_list = []; | ||
20 | +function jason_to_arry() { | ||
21 | + for (var data in jsonData) { | ||
22 | + first_first.push(jsonData[data]['1학년 1학기']); | ||
23 | + first_second.push(jsonData[data]['1학년 2학기']); | ||
24 | + second_first.push(jsonData[data]['2학년 1학기']); | ||
25 | + second_second.push(jsonData[data]['2학년 2학기']); | ||
26 | + third_first.push(jsonData[data]['3학년 1학기']); | ||
27 | + third_second.push(jsonData[data]['3학년 2학기']); | ||
28 | + fourth_first.push(jsonData[data]['4학년 1학기']); | ||
29 | + fourth_second.push(jsonData[data]['4학년 2학기']); | ||
30 | + } | ||
31 | +} | ||
32 | +function remove_null() { | ||
33 | + first_first = first_first.filter(function (item) { | ||
34 | + return item !== null && item !== undefined && item !== ''; | ||
35 | + }); | ||
36 | + first_second = first_second.filter(function (item) { | ||
37 | + return item !== null && item !== undefined && item !== ''; | ||
38 | + }); | ||
39 | + second_first = second_first.filter(function (item) { | ||
40 | + return item !== null && item !== undefined && item !== ''; | ||
41 | + }); | ||
42 | + second_second = second_second.filter(function (item) { | ||
43 | + return item !== null && item !== undefined && item !== ''; | ||
44 | + }); | ||
45 | + third_first = third_first.filter(function (item) { | ||
46 | + return item !== null && item !== undefined && item !== ''; | ||
47 | + }); | ||
48 | + third_second = third_second.filter(function (item) { | ||
49 | + return item !== null && item !== undefined && item !== ''; | ||
50 | + }); | ||
51 | + fourth_first = fourth_first.filter(function (item) { | ||
52 | + return item !== null && item !== undefined && item !== ''; | ||
53 | + }); | ||
54 | + fourth_second = fourth_second.filter(function (item) { | ||
55 | + return item !== null && item !== undefined && item !== ''; | ||
56 | + }); | ||
57 | + new_list.push(first_first); | ||
58 | + new_list.push(first_second) | ||
59 | + new_list.push(second_first) | ||
60 | + new_list.push(second_second); | ||
61 | + new_list.push(third_first) | ||
62 | + new_list.push(third_second); | ||
63 | + new_list.push(fourth_first); | ||
64 | + new_list.push(fourth_second); | ||
65 | +} | ||
66 | +jason_to_arry() | ||
67 | +remove_null() | ||
68 | + | ||
69 | + | ||
70 | +const connect = mongoose.connect(config.url, | ||
71 | + { | ||
72 | + useNewUrlParser: true, | ||
73 | + useUnifiedTopology: true, | ||
74 | + }) | ||
75 | + .then(() => console.log("DB : Succesfully Connected")) | ||
76 | + .catch((err) => console.log(err.message)); | ||
77 | + | ||
78 | + | ||
79 | +var express = require('express'); | ||
80 | + | ||
81 | +const { Subinfo } = require('./models/model'); | ||
82 | +var request = require('request'); | ||
83 | +var options = { | ||
84 | + 'method': 'GET', | ||
85 | + 'url': 'https://sugang.khu.ac.kr/core?attribute=lectListJson&lang=ko&loginYn=N&menu=1&p_major=A07337&p_year=2022&p_term=10&initYn=Y', | ||
86 | + 'headers': { | ||
87 | + 'Cookie': 'JSESSIONID=aHGSkYnn7ZmXH5Wgx8So3tatw4J7LyR5g98tqYffSUU7qPhC7FFjOaemFCb8UgU5.amV1c19kb21haW4vV0hfU3VnYW5nMQ==; WMONID=R84FN19dbP4' | ||
88 | + }, | ||
89 | + formData: { | ||
90 | + 'attribute': 'lectListJson', | ||
91 | + 'lang': 'ko', | ||
92 | + 'loginYn': 'N', | ||
93 | + 'menu': '1', | ||
94 | + 'p_major': 'A07308', | ||
95 | + 'p_year': '2022', | ||
96 | + 'p_term': '10', | ||
97 | + 'initYn': 'Y' | ||
98 | + } | ||
99 | +}; | ||
100 | +request(options, async function (error, response) { | ||
101 | + if (error) throw new Error(error); | ||
102 | + var jason = response.body | ||
103 | + var json = JSON.parse(jason) | ||
104 | + | ||
105 | + const data = {} | ||
106 | + | ||
107 | + for (var i in json["rows"]) { | ||
108 | + // console.log(json["rows"][i]) | ||
109 | + } | ||
110 | + | ||
111 | + var x = 0, y = 0; | ||
112 | + for (var i = 0; i < new_list.length; i++) { | ||
113 | + var z = '필수'; | ||
114 | + if (i % 2 == 0) { | ||
115 | + x++; | ||
116 | + } | ||
117 | + for (var j = 0; j < new_list[i].length; j++) { | ||
118 | + if (new_list[i][j] == '선택') { | ||
119 | + z = '선택'; | ||
120 | + continue; | ||
121 | + } | ||
122 | + if (i % 2 == 0) { | ||
123 | + y = 1; | ||
124 | + } else { | ||
125 | + y = 2; | ||
126 | + } | ||
127 | + var subinfo = new Subinfo({ | ||
128 | + campus: "국제", | ||
129 | + college: "소프트웨어융합대학", | ||
130 | + department: "소프트웨어융합학과_게임콘텐츠", | ||
131 | + grade: x + "학년" + y + "학기", | ||
132 | + name: new_list[i][j], | ||
133 | + choice: z, | ||
134 | + }) | ||
135 | + subinfo.save((err, result) => { | ||
136 | + if (err) { | ||
137 | + return err; | ||
138 | + } else { | ||
139 | + // console.log(result); | ||
140 | + } | ||
141 | + }) | ||
142 | + } | ||
143 | + } | ||
144 | + for (var i in json["rows"]) { | ||
145 | + var obj = {}; | ||
146 | + obj['time'] = json["rows"][i]["timetable"]; | ||
147 | + obj['prof'] = json["rows"][i]["teach_na"]; | ||
148 | + obj['credit'] = json["rows"][i]["unit_num"]; | ||
149 | + obj['name'] = json["rows"][i]["subjt_name"]; | ||
150 | + await Subinfo.findOne({department: "소프트웨어융합학과_게임콘텐츠", name:obj['name']}).then((sub)=>{ | ||
151 | + if(sub){ | ||
152 | + var body={ | ||
153 | + prof:obj['prof'], | ||
154 | + time:obj['time'] | ||
155 | + } | ||
156 | + sub.credit=obj['credit'] | ||
157 | + sub.subject.push(body); | ||
158 | + sub.save((err,result)=>{ | ||
159 | + if(err){ | ||
160 | + console.log(err) | ||
161 | + }else if(result){ | ||
162 | + // console.log(result); | ||
163 | + } | ||
164 | + }) | ||
165 | + } | ||
166 | + }) | ||
167 | + } | ||
168 | +}); | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
... | @@ -17,4 +17,4 @@ const mongoose = require("mongoose"); | ... | @@ -17,4 +17,4 @@ const mongoose = require("mongoose"); |
17 | }); | 17 | }); |
18 | 18 | ||
19 | const Subinfo = mongoose.model('Subinfo', SubSchema); | 19 | const Subinfo = mongoose.model('Subinfo', SubSchema); |
20 | - module.exports = {Subinfo}; | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
20 | + module.exports = { Subinfo }; | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
DB_collect/package-lock.json
0 → 100644
This diff is collapsed. Click to expand it.
1 | { | 1 | { |
2 | + "name": "db_collect", | ||
3 | + "version": "1.0.0", | ||
4 | + "description": "", | ||
5 | + "main": "AI.js", | ||
6 | + "scripts": { | ||
7 | + "test": "echo \"Error: no test specified\" && exit 1" | ||
8 | + }, | ||
9 | + "keywords": [], | ||
10 | + "author": "", | ||
11 | + "license": "ISC", | ||
2 | "dependencies": { | 12 | "dependencies": { |
13 | + "express": "^4.18.1", | ||
14 | + "mongoose": "^6.3.5", | ||
3 | "request": "^2.88.2", | 15 | "request": "^2.88.2", |
4 | "xlsx": "^0.18.5" | 16 | "xlsx": "^0.18.5" |
5 | } | 17 | } | ... | ... |
excelread.js
deleted
100644 → 0
1 | -const xlsx = require( "xlsx" ); | ||
2 | -// 엑셀 파일을 가져오기 | ||
3 | - | ||
4 | -const excelFile = xlsx.readFile("./GuideLine/컴퓨터공학과 권장이수 가이드라인.xlsx"); | ||
5 | -// 엑셀 파일의 첫번째 시트의 정보 추출 | ||
6 | - | ||
7 | -const sheetName = excelFile.SheetNames[0]; | ||
8 | -const firstSheet = excelFile.Sheets[sheetName]; | ||
9 | -const jsonData = xlsx.utils.sheet_to_json(firstSheet); | ||
10 | -var first_first = []; | ||
11 | -var first_second = []; | ||
12 | -var second_first = []; | ||
13 | -var second_second = []; | ||
14 | -var third_first = []; | ||
15 | -var third_second = []; | ||
16 | -var fourth_first = []; | ||
17 | -var fourth_second = []; | ||
18 | - | ||
19 | -function jason_to_arry() { | ||
20 | - for (var data in jsonData){ | ||
21 | - first_first.push(jsonData[data]['1학년 1학기']); | ||
22 | - first_second.push(jsonData[data]['1학년 2학기']); | ||
23 | - second_first.push(jsonData[data]['2학년 1학기']); | ||
24 | - second_second.push(jsonData[data]['2학년 2학기']); | ||
25 | - third_first.push(jsonData[data]['3학년 1학기']); | ||
26 | - third_second.push(jsonData[data]['3학년 2학기']); | ||
27 | - fourth_first.push(jsonData[data]['4학년 1학기']); | ||
28 | - fourth_second.push(jsonData[data]['4학년 2학기']); | ||
29 | - } | ||
30 | -} | ||
31 | -// jason -> array로 변경 | ||
32 | -function remove_null() { | ||
33 | -first_first = first_first.filter(function(item) { | ||
34 | - return item !== null && item !== undefined && item !== ''; | ||
35 | -}); | ||
36 | -first_second = first_second.filter(function(item) { | ||
37 | - return item !== null && item !== undefined && item !== ''; | ||
38 | - }); | ||
39 | -second_first = second_first.filter(function(item) { | ||
40 | - return item !== null && item !== undefined && item !== ''; | ||
41 | -}); | ||
42 | -second_second = second_second.filter(function(item) { | ||
43 | - return item !== null && item !== undefined && item !== ''; | ||
44 | - }); | ||
45 | -third_first = third_first.filter(function(item) { | ||
46 | - return item !== null && item !== undefined && item !== ''; | ||
47 | - }); | ||
48 | -third_second = third_second.filter(function(item) { | ||
49 | - return item !== null && item !== undefined && item !== ''; | ||
50 | - }); | ||
51 | -fourth_first = fourth_first.filter(function(item) { | ||
52 | - return item !== null && item !== undefined && item !== ''; | ||
53 | - }); | ||
54 | -fourth_second = fourth_second.filter(function(item) { | ||
55 | - return item !== null && item !== undefined && item !== ''; | ||
56 | - }); | ||
57 | -} | ||
58 | -// null 값 제거 | ||
59 | - | ||
60 | - | ||
61 | -jason_to_arry() | ||
62 | -remove_null() | ||
63 | - | ||
64 | -console.log(first_first); |
package-lock.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
소프트웨어융합학과.js
deleted
100644 → 0
1 | -var request = require('request'); | ||
2 | -var options = { | ||
3 | - 'method': 'GET', | ||
4 | - 'url': 'https://sugang.khu.ac.kr/core?attribute=lectListJson&lang=ko&loginYn=N&menu=1&p_major=A07337&p_year=2022&p_term=10&initYn=Y', | ||
5 | - 'headers': { | ||
6 | - 'Cookie': 'JSESSIONID=aHGSkYnn7ZmXH5Wgx8So3tatw4J7LyR5g98tqYffSUU7qPhC7FFjOaemFCb8UgU5.amV1c19kb21haW4vV0hfU3VnYW5nMQ==; WMONID=R84FN19dbP4' | ||
7 | - }, | ||
8 | - formData: { | ||
9 | - 'attribute': 'lectListJson', | ||
10 | - 'lang': 'ko', | ||
11 | - 'loginYn': 'N', | ||
12 | - 'menu': '1', | ||
13 | - 'p_major': 'A07337', | ||
14 | - 'p_year': '2022', | ||
15 | - 'p_term': '10', | ||
16 | - 'initYn': 'Y' | ||
17 | - } | ||
18 | -}; | ||
19 | -request(options, function (error, response) { | ||
20 | - if (error) throw new Error(error); | ||
21 | - var jason = response.body | ||
22 | - var json = JSON.parse(jason) | ||
23 | - | ||
24 | - const data = {} | ||
25 | - | ||
26 | - for (var i in json["rows"]){ | ||
27 | - var obj = {}; | ||
28 | - obj['name'] = json["rows"][i]["subjt_name"]; | ||
29 | - obj['time'] = json["rows"][i]["timetable"]; | ||
30 | - obj['prof'] = json["rows"][i]["teach_na"]; | ||
31 | - obj['credit'] = json["rows"][i]["unit_num"]; | ||
32 | - console.log(obj); | ||
33 | - } | ||
34 | -}); |
인공지능학과.js
deleted
100644 → 0
1 | -var request = require('request'); | ||
2 | -var options = { | ||
3 | - 'method': 'GET', | ||
4 | - 'url': 'https://sugang.khu.ac.kr/core?attribute=lectListJson&lang=ko&loginYn=N&menu=1&p_major=A10628&p_year=2022&p_term=10&initYn=Y', | ||
5 | - 'headers': { | ||
6 | - 'Cookie': 'JSESSIONID=0hka3HzdSAOOvWw17F0W3OixVWW5MKzJg31nZrYU3yjMlmIv7GF9vasjvDsYwTAe.amV1c19kb21haW4vV0hfU3VnYW5nMQ==; WMONID=R84FN19dbP4' | ||
7 | - }, | ||
8 | - formData: { | ||
9 | - 'attribute': 'lectListJson', | ||
10 | - 'lang': 'ko', | ||
11 | - 'loginYn': 'N', | ||
12 | - 'menu': '1', | ||
13 | - 'p_major': 'A10628', | ||
14 | - 'p_year': '2022', | ||
15 | - 'p_term': '10', | ||
16 | - 'initYn': 'Y' | ||
17 | - } | ||
18 | -}; | ||
19 | -request(options, function (error, response) { | ||
20 | - if (error) throw new Error(error); | ||
21 | - var jason = response.body | ||
22 | - var json = JSON.parse(jason) | ||
23 | - | ||
24 | - const data = {} | ||
25 | - | ||
26 | - for (var i in json["rows"]){ | ||
27 | - var obj = {}; | ||
28 | - obj['name'] = json["rows"][i]["subjt_name"]; | ||
29 | - obj['time'] = json["rows"][i]["timetable"]; | ||
30 | - obj['prof'] = json["rows"][i]["teach_na"]; | ||
31 | - obj['credit'] = json["rows"][i]["unit_num"]; | ||
32 | - console.log(obj); | ||
33 | - } | ||
34 | -}); |
컴퓨터공학.js
deleted
100644 → 0
1 | -var request = require('request'); | ||
2 | -var options = { | ||
3 | - 'method': 'GET', | ||
4 | - 'url': 'https://sugang.khu.ac.kr/core?attribute=lectListJson&lang=ko&loginYn=N&menu=1&p_major=A07308&p_year=2022&p_term=10&initYn=Y', | ||
5 | - 'headers': { | ||
6 | - 'Cookie': 'JSESSIONID=aHGSkYnn7ZmXH5Wgx8So3tatw4J7LyR5g98tqYffSUU7qPhC7FFjOaemFCb8UgU5.amV1c19kb21haW4vV0hfU3VnYW5nMQ==; WMONID=R84FN19dbP4' | ||
7 | - }, | ||
8 | - formData: { | ||
9 | - 'attribute': 'lectListJson', | ||
10 | - 'lang': 'ko', | ||
11 | - 'loginYn': 'N', | ||
12 | - 'menu': '1', | ||
13 | - 'p_major': 'A07308', | ||
14 | - 'p_year': '2022', | ||
15 | - 'p_term': '10', | ||
16 | - 'initYn': 'Y' | ||
17 | - } | ||
18 | -}; | ||
19 | -request(options, function (error, response) { | ||
20 | - if (error) throw new Error(error); | ||
21 | - var jason = response.body | ||
22 | - var json = JSON.parse(jason) | ||
23 | - | ||
24 | - const data = {} | ||
25 | - | ||
26 | - for (var i in json["rows"]){ | ||
27 | - var obj = {}; | ||
28 | - obj['name'] = json["rows"][i]["subjt_name"]; | ||
29 | - obj['time'] = json["rows"][i]["timetable"]; | ||
30 | - obj['prof'] = json["rows"][i]["teach_na"]; | ||
31 | - obj['credit'] = json["rows"][i]["unit_num"]; | ||
32 | - console.log(obj); | ||
33 | - } | ||
34 | - | ||
35 | -}); | ||
36 | - |
컴퓨터공학과.js
deleted
100644 → 0
1 | -var request = require('request'); | ||
2 | -var options = { | ||
3 | - 'method': 'GET', | ||
4 | - 'url': 'https://sugang.khu.ac.kr/core?attribute=lectListJson&lang=ko&loginYn=N&menu=1&p_major=A10627&p_year=2022&p_term=10&initYn=Y', | ||
5 | - 'headers': { | ||
6 | - 'Cookie': 'JSESSIONID=0hka3HzdSAOOvWw17F0W3OixVWW5MKzJg31nZrYU3yjMlmIv7GF9vasjvDsYwTAe.amV1c19kb21haW4vV0hfU3VnYW5nMQ==; WMONID=R84FN19dbP4' | ||
7 | - }, | ||
8 | - formData: { | ||
9 | - 'attribute': 'lectListJson', | ||
10 | - 'lang': 'ko', | ||
11 | - 'loginYn': 'N', | ||
12 | - 'menu': '1', | ||
13 | - 'p_major': 'A10627', | ||
14 | - 'p_year': '2022', | ||
15 | - 'p_term': '10', | ||
16 | - 'initYn': 'Y' | ||
17 | - } | ||
18 | - | ||
19 | -}; | ||
20 | - | ||
21 | -request(options, function (error, response) { | ||
22 | - if (error) throw new Error(error); | ||
23 | - var jason = response.body | ||
24 | - var json = JSON.parse(jason) | ||
25 | - | ||
26 | - for (var i in json["rows"]){ | ||
27 | - var obj = {}; | ||
28 | - obj['name'] = json["rows"][i]["subjt_name"]; | ||
29 | - obj['time'] = json["rows"][i]["timetable"]; | ||
30 | - obj['prof'] = json["rows"][i]["teach_na"]; | ||
31 | - obj['credit'] = json["rows"][i]["unit_num"]; | ||
32 | - console.log(obj); | ||
33 | - } | ||
34 | -}); | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or login to post a comment