@ -204,7 +204,7 @@ def load_cache():
app.logger.info('loading latest tipped into cache')
get_latest_tipped_posts()
app.logger.info('done')
for i in [1, 3, 7, 30]:
for i in [1, 3, 7, 30, 9999]:
app.logger.info(f'loading top posts last {i} days into cache')
get_top_posts(i)
@ -23,7 +23,7 @@ def top_posts():
except:
days = 1
if days not in [1, 3, 7, 30]:
if days not in [1, 3, 7, 30, 9999]:
days = 7
posts = get_top_posts(days)
@ -23,6 +23,7 @@
<a class="navbar-item" href="{{ url_for('leaderboard.top_posts') }}?days=3">Top Memes Last 3 Days</a>
<a class="navbar-item" href="{{ url_for('leaderboard.top_posts') }}?days=7">Top Memes Last Week</a>
<a class="navbar-item" href="{{ url_for('leaderboard.top_posts') }}?days=30">Top Memes Last Month</a>
<a class="navbar-item" href="{{ url_for('leaderboard.top_posts') }}?days=9999">Top Memes All Time</a>
</div>
<a class="navbar-item" href="{{ url_for('about') }}">About</a>
@ -10,6 +10,7 @@
{% if posts %}
{% for row in posts | sort(attribute='received_wow', reverse=True) | batch(4) %}
<div class="columns">
{% if loop.index < 15 %}
{% for post in row %}
<div class="column">
<div class="card">
@ -37,6 +38,7 @@
{% endfor %}
{% endif %}
{% else %}
@ -96,7 +96,8 @@ def get_top_posts(days=1):
# stupid magic number bcuz fuck it
hours = 24 * days