Spontan raff ich das grad voll nicht!???
Kann mir mal bitte jemand verraten warum hier items aus dem Tagesschau-Feed dabei sind (wenn man in den News unten scrollt):
[https://frdlweb.de/#services](https://frdlweb.de/#services)
> <div webfan-rss-feeds="[https://frdl.de/user_support/faq/group/139?view=rss](https://frdl.de/user_support/faq/group/139?view=rss) [https://frdl.de/groups/profile/97/frdlweb-software?view=rss](https://frdl.de/groups/profile/97/frdlweb-software?view=rss) [https://frdl.de/groups/profile/139/webmaster?view=rss](https://frdl.de/groups/profile/139/webmaster?view=rss) [https://frdl.de/groups/profile/152/weid-consortium?view=rss](https://frdl.de/groups/profile/152/weid-consortium?view=rss)" webfan-rss-headline="h3" webfan-rss-max-items="15" style="max-height:3000px;"></div>
Hab den cache gecleared, wie kommen dann feeds aus der News seite da rein?
```
async function rssFeedsComponent(){
frdlweb.watch('[webfan-rss-feeds]', el=>{
var feeds = el.getAttribute('webfan-rss-feeds').split(' ');
var headLineSelector = el.hasAttribute('webfan-rss-headline') ? el.getAttribute('webfan-rss-headline') : 'h3';
var maxFeeds = el.hasAttribute('webfan-rss-max-items') ? parseInt(el.getAttribute('webfan-rss-max-items')) : -1;
// console.log('feeds', feeds);
global.global.requirejs(['jquery', 'ngprogress'], async(jquery, ngprogress)=>{
ngprogress.set(0.1);
var parse = await frdlweb.Webfan.rss2json;
ngprogress.set(0.2);
await jquery;
ngprogress.set(0.3);
var promises = [];
feeds.forEach(feed=>{
promises.push(
new Promise(async(resolve,reject)=>{
parse(feed).then(rss => {
// console.log('rss', rss);
resolve(rss);
}).catch(err=>{
reject(err);
});
}));
});
ngprogress.set(0.4);
Promise.all(promises).then(results=>{
ngprogress.set(0.7);
// console.log('results', results);
var items = [], more = [];
results.forEach(result=>{
result.items.forEach(i=>{
if(items.indexOf(i) === -1){
items.push(i);
}
});
});
items = shuffle(items);
// console.log('items.length', items.length);
while(maxFeeds > 0 && items.length > maxFeeds){
more.push(items.pop());
}
ngprogress.set(0.8);
// console.log('items', items);
window.jQuery(el).css('overflow', 'scroll');//.css('max-height', '1024px');
window.jQuery(el).on('scroll', ()=>{
if(more.length<=0)return;
var item = more.pop();
var html = 'undefined'!== typeof item.content ? item.content : item.description;
var title = document.createElement(headLineSelector);
window.jQuery(title).html(item.title);
el.appendChild(title);
window.jQuery(el).append('<a href="'+item.link+'" target="_blank">'+item.link.substr(0,42)+'...</a>');
window.jQuery(el).append('<div>'+html+'</div>');
window.jQuery(el).append('<a href="'+item.link+'" target="_blank">'+item.link.substr(0,42)+'...</a>');
window.jQuery(el).append('<br />');
window.jQuery(el).find('img').css('max-width', '316px').css('width', 'auto').css('height', 'auto');
window.jQuery(el).find('a').attr('target', '_blank');
});
items.forEach(item=>{
// console.log('item', item);
var html = 'undefined'!== typeof item.content ? item.content : item.description;
var title = document.createElement(headLineSelector);
window.jQuery(title).html(item.title);
el.appendChild(title);
window.jQuery(el).append('<a href="'+item.link+'" target="_blank">'+item.link.substr(0,42)+'...</a>');
window.jQuery(el).append('<div>'+html+'</div>');
window.jQuery(el).append('<a href="'+item.link+'" target="_blank">'+item.link.substr(0,42)+'...</a>');
window.jQuery(el).append('<br />');
});
ngprogress.set(0.9);
window.jQuery(el).find('img').css('max-width', '316px').css('width', 'auto').css('height', 'auto');
window.jQuery(el).find('a').attr('target', '_blank');
ngprogress.done(true);
}).catch(err=>{
console.warn(err);
ngprogress.done(true);
});
});
});
}
```
Melanie Wehowski ·