diff --git a/filters/mememe.plugin b/filters/mememe.plugin index eb347c7..930ecb8 100644 --- a/filters/mememe.plugin +++ b/filters/mememe.plugin @@ -80,6 +80,12 @@ def canonicalize(url): revmap[canonurl] = url return canonurl +def unique_votes(links): + voters = [] + for weight, entry, feed, title, author, mtime in links: + if feed not in voters: voters.append(feed) + return len(voters) + log.debug("Loading cached data") for name in glob.glob(os.path.join(cache, '*')): # ensure that this is within the past week @@ -447,7 +453,7 @@ for i in range(0,len(weighted_links)): voters.append(entry) # add to the meme feed - if len(all_links[link]) > 2: + if unique_votes(all_links[link]) > 2: meme_feed.addContent('\n') entry = meme_feed.newChild(None, 'entry', None) meme_feed.addContent('\n') diff --git a/themes/asf/personalize.js b/themes/asf/personalize.js index 4f36d8a..f89b714 100644 --- a/themes/asf/personalize.js +++ b/themes/asf/personalize.js @@ -95,6 +95,7 @@ function addOption(event) { var h2 = null; for (var i=entries.length; --i>=0;) { + if (document.getElementById("news-" + i)) break; if (entries[i].parent.offsetTop > 0) { var a = entries[i].anchor = document.createElement('a'); a.id = "news-" + i; @@ -103,7 +104,7 @@ function addOption(event) { } } - if (h2 != null) { + if (h2 != null && !document.getElementById("navkeys")) { h2.appendChild(document.createTextNode('Options')); sidebar.appendChild(h2);