Rank nodes by size.

This commit is contained in:
2021-03-07 21:14:10 +01:00
parent 7b23388285
commit 95e4f32bba
2 changed files with 5 additions and 2 deletions
+2 -2
View File
@@ -49,7 +49,7 @@ def latest():
@bp.route('/today')
def today():
today = datetime.datetime.now().date()
return redirect("https://anagora.org/node/%s" % today.strftime("%Y-%m-%d"))
return redirect("/node/%s" % today.strftime("%Y-%m-%d"))
@bp.route('/oldsearch', methods=('GET', 'POST'))
def oldsearch():
@@ -269,7 +269,7 @@ def garden(garden):
# Lists
@bp.route('/nodes')
def nodes():
return render_template('nodes.html', nodes=G.nodes(include_journals=False).values())
return render_template('nodes.html', nodes=db.top())
@bp.route('/nodes.json')
def nodes_json():
+3
View File
@@ -548,6 +548,9 @@ def content_to_forward_links(content):
def latest():
return sorted(G.subnodes(), key=lambda x: -x.mtime)
def top():
return sorted(G.nodes().values(), key=lambda x: -x.size())
def all_users():
# hack hack.
users = os.listdir(os.path.join(config.AGORA_PATH, 'garden'))