Skip to content

API Exploration: School Website

Marks Polakovs edited this page Nov 7, 2016 · 2 revisions

Teacher absences

GET http://www.euroschool.lu/luxschool/absences_student.php. (No authentication.) Then you get to the fun bit. The returned HTML (bleurgh) looks like:

<!-- snip -->
<p class="style2">      <img src="images/bogus_star_bullet_white.gif" width="12" height="11"> TEACHER NAME HERE       
        <font size ="-1"> <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                
        </font><br>
     
              <img src="images/bogus_star_bullet_white.gif" width="12" height="11"> TEACHER NAME HERE      
        <font size ="-1"> <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                
        </font><br>
     
        </p>

Describing how to parse it is too painful (bleeeeeeeurgh), so here's some JavaScript:

const parse = html =>
    Array.from($('img'))
    .map(star => star.nextSibling.nodeValue.trim());
Clone this wiki locally