start-ffhh/js/main.js
2014-09-12 15:45:34 +02:00

26 lines
741 B
JavaScript

var rss = [
'hamburg.freifunk.net'
];
var MAX_RSS = 5;
$(document).ready(function() {
var i = 0;
rss.forEach(function(feed) {
$.get('/feeds/' + feed + '.rss', function(data) {
$(data).find('item').forEach(function(entry) {
if(i >= MAX_RSS) return;
var title = $(entry).find('title').text();
var link = $(entry).find('link').text();
var item = $('<a>')
.attr('class', 'css-truncate')
.attr('href', link)
.attr('target', '_blank')
.text(title);
$('#news').append($('<li>').append(item));
i++;
});
});
});
});