diff --git a/src/build.py b/src/build.py index 39e535a..1fe8a6e 100644 --- a/src/build.py +++ b/src/build.py @@ -258,7 +258,13 @@ def build_statistics_page(page, articles): content += "
\n".join(cited_times_items) content += "\n" - # Lowest pagerank + # Lowest pagerank of written articles + G = networkx.Graph() + for article in articles: + for citation in article.citations: + if citation.article.player is not None: + G.add_edge(article.title, citation.target) + rank_by_article = networkx.pagerank(G) pageranks = reverse_statistics_dict(rank_by_article) bot_ranked = list(enumerate(map(lambda x: x[1], pageranks), start=1))[-10:] # Format the ranks into strings @@ -268,7 +274,6 @@ def build_statistics_page(page, articles): content += "
\n".join(bot_ranked_items) content += "\n" - # Fill in the entry skeleton return page.format(title="Statistics", content=content)