Added cfl news under the bus arrivals

fixes #3
gh-pages
Thierry Degeling 2014-07-23 17:39:10 +01:00
parent 0898ccd358
commit d6b10f9d7f
2 changed files with 38 additions and 2 deletions

View File

@ -53,6 +53,7 @@
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="panel busses"></div> <div class="panel busses"></div>
<div class="cfl"></div>
</div> </div>
<div class="col-md-4 news"> <div class="col-md-4 news">
</div> </div>

View File

@ -36,6 +36,12 @@
wortLuNews(); wortLuNews();
}, 900000); }, 900000);
cflNews();
setInterval( function() {
cflNews();
}, 900000);
}); });
@ -267,8 +273,6 @@ function wortLuNews() {
var articles = response.responseJSON.articles; var articles = response.responseJSON.articles;
console.log( articles )
var output = ''; var output = '';
for ( var ArticleNR = 0; ArticleNR < 5; ArticleNR++ ) { 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' ); 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 += '<div class="panel">'
+ '<h1>' + $(this).find("title").text() + '</h1>'
+ $(this).find("description").text()
+ '</div>';
});
$('.cfl').html('').append( output );
}
});
console.log( moment().format('YYYY.MM.DD - HH:mm:ss') + ' updated cfl News' );
}