From 72c89e8bd1cbb383d3d14ddad07825990883b088 Mon Sep 17 00:00:00 2001 From: Diogo Correia Date: Tue, 23 Aug 2022 16:03:32 +0100 Subject: [PATCH] minor changes in documentation --- .dockerignore | 3 ++- README.md | 4 ++-- docs/README.md | 10 +++++----- docs/paco-ua-api.yml | 6 ++++++ routes/schedule.js | 2 +- scrapers.js | 4 ++-- 6 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.dockerignore b/.dockerignore index b512c09..94c4a26 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1,2 @@ -node_modules \ No newline at end of file +node_modules +.heroku-rep \ No newline at end of file diff --git a/README.md b/README.md index a3ff250..1e544fe 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ docker run -p 8000:8000 --name pacoua-api pacoua-api --- -(To run on a different port, change the value of the port on the left side (***8000***:8000) in the command above) +(To run on a different port, change the value of the port on the left side (***8000***:8000) in the command above. The port on the right ride (8000:***8000***) has to always match the port in the file static.js) ### Setup the server locally manually: @@ -115,7 +115,7 @@ If everything is correct, this should be the response: ... }, "school_year": "2021/2022", - "semester": "1" + "semester": 1 }, "url": "https://paco.ua.pt/secvirtual/horarios/c_horario_aluno.asp", "title": "Horário", diff --git a/docs/README.md b/docs/README.md index fc183e0..caa44a4 100644 --- a/docs/README.md +++ b/docs/README.md @@ -913,7 +913,7 @@ RESPONSE: 5s 🟡 ... }, "school_year": "2021/2022", - "semester": "1" + "semester": 1 }, "url": "https://paco.ua.pt/secvirtual/horarios/c_horario_aluno.asp", "title": "Horário", @@ -941,7 +941,7 @@ RESPONSE: 4.5s 🟢 }, "start": "12h", "duration": "1,5h", - "capacity": "101", + "capacity": 101, "room": "ANF. IV" }, { @@ -951,7 +951,7 @@ RESPONSE: 4.5s 🟢 }, "start": "14,5h", "duration": "2h", - "capacity": "18", + "capacity": 18, "room": "04.2.16" }, ... @@ -965,14 +965,14 @@ RESPONSE: 4.5s 🟢 }, "start": "14h", "duration": "2h", - "capacity": "19", + "capacity": 19, "room": "04.3.30" } ], ... }, "school_year": "2021/2022", - "semester": "2" + "semester": 2 }, "url": "https://paco.ua.pt/secvirtual/horarios/desenho_horario.asp?tipo=1&value=-210320212", "title": "Horário de REDES DE COMUNICAÇÕES II", diff --git a/docs/paco-ua-api.yml b/docs/paco-ua-api.yml index 1a888f6..1d8c303 100644 --- a/docs/paco-ua-api.yml +++ b/docs/paco-ua-api.yml @@ -180,6 +180,12 @@ components: started_date: type: string description: Date of initiation of the subject + recurso: + type: string + description: Date of the "Recurso" Season + especial: + type: string + description: Date of the "Especial" Season SubjectHistory: type: object properties: diff --git a/routes/schedule.js b/routes/schedule.js index 1170c19..83e47f0 100644 --- a/routes/schedule.js +++ b/routes/schedule.js @@ -31,7 +31,7 @@ const setup = { * type: string * description: School year in the schedule * semester: - * type: string + * type: integer * description: Semester in the schedule */ diff --git a/scrapers.js b/scrapers.js index 1a36423..a3d3895 100644 --- a/scrapers.js +++ b/scrapers.js @@ -197,13 +197,13 @@ module.exports = { if (scheduleInfoElem.childNodes.length == 1) { const scheduleInfo = scheduleInfoElem.childNodes[0].wholeText; data["school_year"] = scheduleInfo.split(" - ")[3], - data["semester"] = scheduleInfo.split(" - ")[2].split("º")[0]; + data["semester"] = Number(scheduleInfo.split(" - ")[2].split("º")[0]); } // student schedule else { const scheduleInfo = scheduleInfoElem.childNodes[2].wholeText; data["school_year"] = scheduleInfo.split(" - ")[1].split("AnoLectivo: ")[1]; - data["semester"] = scheduleInfo.split(" - ")[2].split("º")[0]; + data["semester"] = Number(scheduleInfo.split(" - ")[2].split("º")[0]); } // subjects