blob: 7ea719449e70d11f6a6610175749e5ee0be1dd64 [file] [log] [blame]
Dani Vilardell21dacea2020-09-21 14:25:20 +02001
2const fs = require('fs');
3
Andreu Huguetf4581a42020-09-17 13:33:44 +02004let hores = [], newhour;
Dani Vilardell21dacea2020-09-21 14:25:20 +02005
Andreu Huguetf4581a42020-09-17 13:33:44 +02006for (let h = 8; h < 22; ++h) {
7 newhour = "";
8 if (h < 10) newhour += "0";
9 newhour += h.toString();
10
11 hores.push(newhour + ":00");
12 hores.push(newhour + ":30");
13}
14
15hores.forEach(hora => {
16 let column = 1;
17 let td = $("td:contains(" + hora + ")").next();
18
19 while (td.text().indexOf(hora) == -1) {
20
21 if (td.text().indexOf("CDATA") == -1) {
22 let aula = $("#day_main th")[column].textContent.trim();
23 let durada = parseInt(td.attr("rowspan"))*30;
24
25 console.log(td.text()
26 + ", " + hora
27 + ", " + durada + "mins"
28 + ", " + aula);
29 }
30
31 td = td.next();
32 ++column;
33 }
34});