read from json html
diff --git a/horaris.json b/horaris.json
new file mode 100644
index 0000000..3d84dd3
--- /dev/null
+++ b/horaris.json
@@ -0,0 +1 @@
+classes = '[{"nom" : "ÀLGEBRA MULTILINIAL", "hora" : "08:00-9:00", "aula" : "S02"}, {"nom" : "ÀLGEBRA MULTILINIAL2", "hora" : "09:00-10:00", "aula" : "S02"}, {"nom" : "ÀLGEBRA MULTILINIAL3", "hora" : "10:00-11:00", "aula" : "S02"}, {"nom" : "ÀLGEBRA MULTILINIAL4", "hora" : "11:00-12:00", "aula" : "S02"}, {"nom" : "ÀLGEBRA MULTILINIAL5", "hora" : "12:00-13:00", "aula" : "S02"}]';
\ No newline at end of file
diff --git a/main.html b/main.html
index 0d4b680..bf16a34 100644
--- a/main.html
+++ b/main.html
@@ -1,10 +1,14 @@
+<script type="text/javascript" src="./horaris.json"></script>
+
 <html>
     <head>
     </head>
     <body>
         <h1>App de traçabilitat DAFME</h1>
         <h2>Estructures Algebràiques</h2>
+        <h2 id = "assignatura"></h2>
         <h3>Aula S03</h3>
+        <h3 id = "aula"></h3>
         <a href="#">No és així? Canvia-ho.</a>
         
         <h2 id="hora">
@@ -15,6 +19,8 @@
         <a href="#">No és així? Canvia-ho.</a>
         
         <script>
+        	var mydata = JSON.parse(classes);
+
             var hora_actual = new Date();
             var minuts;
             
@@ -33,6 +39,14 @@
             var mes = hora_actual.getMonth() + 1;
             var any = hora_actual.getFullYear();
             var data = dia.toString() + '/' + mes.toString() + '/' + any.toString();
+
+            for (i = 0; i < mydata.length; i++) { 
+            	var h = mydata[i].hora.split(":");
+				if(h[0] == (hora_actual.getHours() - 1).toString()) {
+					console.log("trobat");
+					document.getElementById("assignatura").innerHTML = mydata[i].nom;
+				}
+			}
             document.getElementById("data").innerHTML = data;
         </script>
     </body>
diff --git a/table-parser.js b/table-parser.js
index 2a4460c..7ea7194 100644
--- a/table-parser.js
+++ b/table-parser.js
@@ -1,4 +1,8 @@
+
+const fs = require('fs');
+
 let hores = [], newhour;
+
 for (let h = 8; h < 22; ++h) {
     newhour = "";
     if (h < 10) newhour += "0";