var entryInfo = { 
    entryPoint : "stupla_bold",
    skip : 3
}
fixDivHeight();
parse(getLectures(entryInfo));

/*
 * Log the container that holds all relevant information
 */
console.log(" ");
console.log("container:");
console.log(document.getElementById("rechtespalte2"));

/*
 * The VLV has a bad layout due to a single div containing a fixed height. This function fixes this by setting height to auto like it should be.
 */
function fixDivHeight() {
    document.getElementById("rechtespalte2").style.height = "auto";
}

/*
 * Returns an Array of all Lectures shown on the current page.
 */
function getLectures(entryInfo) {
    var list = document.getElementsByClassName(entryInfo.entryPoint);
    var lectures = [];
    var i = entryInfo.skip;
    while (i < list.length) {
        lectures.push(list[i].parentNode);
        i = i + 1;
    } 
    return lectures;
}

/*
 * 
 */
function parse(events) {
    var lectures = [];
    var titles = [];
    var speaker = [];
    for (item in events) {
        var event = events[item];
        lectures.push(event);
        titles.push(getTitleOfLecture(event));
        speaker.push(getSpeakerOfLecture(event));
    }
    
    var i = 0;
    while (i < events.length) {
        console.log("Name: " + titles[i]);
        console.log("Vorlesender: " + speaker[i]);
        console.log(" ");
        i = i + 1;
    }

}

function getTitleOfLecture(event) {
    var child = event.childNodes[1];
    if (child.innerText) {
        var title = child.innerText;
        return title.slice(0, (title.lastIndexOf() - 12));
    }
}

function getSpeakerOfLecture(event) {
    var child = event.childNodes[3];
    return child.innerText.slice(12);
}

@@ -59,16 +59,17 @@
 p : 3%0A%7D%0A
+%0A
 fixDivHe
@@ -85,22 +85,21 @@
 arse(get
-Lect
+Co
 ur
+s
 es(entry
@@ -542,9 +542,9 @@
  an 
-A
+a
 rray
@@ -551,22 +551,21 @@
  of all 
-Lect
+co
 ur
+s
 es shown
@@ -602,22 +602,21 @@
 tion get
-Lect
+Co
 ur
+s
 es(entry
@@ -693,38 +693,37 @@
 Point);%0A    var 
-lect
+co
 ur
+s
 es = %5B%5D;%0A    var
@@ -773,38 +773,37 @@
 ngth) %7B%0A        
-lect
+co
 ur
+s
 es.push(list%5Bi%5D.
@@ -852,22 +852,21 @@
  return 
-lect
+co
 ur
+s
 es;%0A%7D%0A%0A/
@@ -870,16 +870,99 @@
 %0A%0A/*%0A * 
+Returns an array of lectures containing all relevant information about that lecture
 %0A */%0Afun
@@ -973,21 +973,25 @@
 n parse(
-event
+rawCourse
 s) %7B%0A   
@@ -995,22 +995,21 @@
     var 
-lect
+co
 ur
+s
 es = %5B%5D;
@@ -1103,50 +1103,24 @@
 t = 
-events%5Bitem%5D;%0A        lectures.push(event)
+rawCourses%5Bitem%5D
 ;%0A  
@@ -1255,21 +1255,25 @@
 le (i %3C 
-event
+rawCourse
 s.length
@@ -1421,19 +1421,78 @@
 ;%0A    %7D%0A
-%0A%7D%0A
+    return courses;%0A%7D%0A%0A/*%0A * Returns the name of a lecture%0A */
 %0Afunctio
@@ -1495,38 +1495,37 @@
 ction getTitleOf
-Lect
+Co
 ur
+s
 e(event) %7B%0A    v
@@ -1688,16 +1688,59 @@
    %7D%0A%7D%0A%0A
+/*%0A * Returns the speaker of a lecture%0A */%0A
 function
@@ -1842,12 +1842,67 @@
 lice(12);%0A%7D%0A
+%0Afunction getLecture() %7B%0A%0A%7D%0A%0Afunction getLesson() %7B%0A%0A%7D%0A

rename functions