diff --git a/index.html b/index.html index cad7693..a53bb5a 100644 --- a/index.html +++ b/index.html @@ -53,6 +53,7 @@
+
diff --git a/js/level2.js b/js/level2.js index 7a9287e..d227c0c 100644 --- a/js/level2.js +++ b/js/level2.js @@ -36,6 +36,12 @@ wortLuNews(); }, 900000); + cflNews(); + + setInterval( function() { + cflNews(); + }, 900000); + }); @@ -267,8 +273,6 @@ function wortLuNews() { var articles = response.responseJSON.articles; - console.log( articles ) - var output = ''; for ( var ArticleNR = 0; ArticleNR < 5; ArticleNR++ ) { @@ -290,3 +294,34 @@ function wortLuNews() { console.log( moment().format('YYYY.MM.DD - HH:mm:ss') + ' updated WortLu News' ); } + +function cflNews() { + + var request = $.ajax({ + type: 'get', + url: 'http://getcontents.herokuapp.com/?url=http%3A%2F%2Fmobile.cfl.lu%2Fbin%2Fhelp.exe%2Fenl%3Ftpl%3Drss_feed_global', + complete: function( response ) { + + var cfl = response.responseText; + + var output = ''; + + $( $.parseXML( cfl ) ) + .find("item") + .each( function() { + + output += '
' + + '

' + $(this).find("title").text() + '

' + + $(this).find("description").text() + + '
'; + + }); + + $('.cfl').html('').append( output ); + + } + }); + + console.log( moment().format('YYYY.MM.DD - HH:mm:ss') + ' updated cfl News' ); + +}