-
Notifications
You must be signed in to change notification settings - Fork 1
API Exploration: School Website
Marks Polakovs edited this page Nov 7, 2016
·
2 revisions
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>
</font><br>
<img src="images/bogus_star_bullet_white.gif" width="12" height="11"> TEACHER NAME HERE
<font size ="-1"> <br>
</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());