From 5ab832be1911d7c80d6fe1aaac916346643357c0 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Wed, 21 Sep 2016 07:57:00 +0200 Subject: Add new stop words. --- src/web/views/user.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/web/views') diff --git a/src/web/views/user.py b/src/web/views/user.py index 01e26325..c7c318e3 100644 --- a/src/web/views/user.py +++ b/src/web/views/user.py @@ -1,5 +1,6 @@ import string import random +from datetime import datetime, timedelta from flask import (Blueprint, g, render_template, redirect, flash, url_for, request) from flask_babel import gettext @@ -29,7 +30,9 @@ def profile_public(nickname=None): return redirect(url_for('home')) word_size = 6 - articles = ArticleController(user.id).read().all() + filters = {} + filters['retrieved_date__gt'] = datetime.now() - timedelta(weeks=24) + articles = ArticleController(user.id).read(**filters).all() top_words = misc_utils.top_words(articles, n=50, size=int(word_size)) tag_cloud = misc_utils.tag_cloud(top_words) -- cgit