Make memes require three unique voters. Prevent the readdition of items
to the sidebar.
This commit is contained in:
parent
eb2ca9a7d4
commit
84d87f36b4
@ -80,6 +80,12 @@ def canonicalize(url):
|
|||||||
revmap[canonurl] = url
|
revmap[canonurl] = url
|
||||||
return canonurl
|
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")
|
log.debug("Loading cached data")
|
||||||
for name in glob.glob(os.path.join(cache, '*')):
|
for name in glob.glob(os.path.join(cache, '*')):
|
||||||
# ensure that this is within the past week
|
# ensure that this is within the past week
|
||||||
@ -447,7 +453,7 @@ for i in range(0,len(weighted_links)):
|
|||||||
voters.append(entry)
|
voters.append(entry)
|
||||||
|
|
||||||
# add to the meme feed
|
# add to the meme feed
|
||||||
if len(all_links[link]) > 2:
|
if unique_votes(all_links[link]) > 2:
|
||||||
meme_feed.addContent('\n')
|
meme_feed.addContent('\n')
|
||||||
entry = meme_feed.newChild(None, 'entry', None)
|
entry = meme_feed.newChild(None, 'entry', None)
|
||||||
meme_feed.addContent('\n')
|
meme_feed.addContent('\n')
|
||||||
|
@ -95,6 +95,7 @@ function addOption(event) {
|
|||||||
|
|
||||||
var h2 = null;
|
var h2 = null;
|
||||||
for (var i=entries.length; --i>=0;) {
|
for (var i=entries.length; --i>=0;) {
|
||||||
|
if (document.getElementById("news-" + i)) break;
|
||||||
if (entries[i].parent.offsetTop > 0) {
|
if (entries[i].parent.offsetTop > 0) {
|
||||||
var a = entries[i].anchor = document.createElement('a');
|
var a = entries[i].anchor = document.createElement('a');
|
||||||
a.id = "news-" + i;
|
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'));
|
h2.appendChild(document.createTextNode('Options'));
|
||||||
sidebar.appendChild(h2);
|
sidebar.appendChild(h2);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user