// ==UserScript==
// @name heiseTickerKommentare10
// @version 0.1.0
// @author _leBluem_
// @description this is not a good idea 'cos all the article pages of the day must be loaded in background to get this little text...
// @info but its fun to see ;)
// @grant none
// @namespace https://greasyfork.org/..........
// @match http://www.heise.de/newsticker/*
// @match https://www.heise.de/newsticker/*
// @downloadURL none
// ==/UserScript==
(function() {
// add "Kommentare laden" link to date that calls GetComments
$("h4.published.archiv_woche_published").each(function(){
var s = ' Kommentare laden';
$(this).append(s);
});
// find all comments for this day
window.GetComments = function GetComments(e){
//
var ulist=$(e).parent().parent().next().children();
// clear all previous loaded comments
$('span[id*="plugin-page-"]').each(function(){
$(this).remove();
});
// make a span-tag to hold the comments-tag
var urls = [];
var j = 0;
$(ulist).each(function(){
if ( $(this).find('a').attr('href') ) {
urls.push($(this).find('a').attr('href'));
// #plugin-page-0 .. #plugin-page-1 .. #plugin-page-2 ..
$(this).append('');
}
});
// make the span-tag actually load the comments-tag
if ( urls.length > 0 ) {
for (var i = 0; i<= urls.length; i++) {
// var re = new RegExp(/Kommentare lesen(.*)\(([^)]+)\)/); // does not compute anywhere
$("#plugin-page-"+i).load(urls[i] + " div.link_forum_beitrag.news p a");
}
}
};
})();