aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/views.py
diff options
context:
space:
mode:
authorCédric Bonhomme <kimble.mandel@gmail.com>2013-11-17 21:39:52 +0100
committerCédric Bonhomme <kimble.mandel@gmail.com>2013-11-17 21:39:52 +0100
commit7e2e3124941ce0ec35bfd841f64f60a2afe71d09 (patch)
tree8902c59367ca7f2b9fe3315f817ad78cf2569fc5 /pyaggr3g470r/views.py
parentRemoved old requirements.txt file. (diff)
downloadnewspipe-7e2e3124941ce0ec35bfd841f64f60a2afe71d09.tar.gz
newspipe-7e2e3124941ce0ec35bfd841f64f60a2afe71d09.tar.bz2
newspipe-7e2e3124941ce0ec35bfd841f64f60a2afe71d09.zip
Restored tag cloud per feed.
Diffstat (limited to 'pyaggr3g470r/views.py')
-rw-r--r--pyaggr3g470r/views.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py
index a7c99c99..d44b3d60 100644
--- a/pyaggr3g470r/views.py
+++ b/pyaggr3g470r/views.py
@@ -38,6 +38,7 @@ from forms import SigninForm, AddFeedForm
from pyaggr3g470r import app, db
+import utils
import feedgetter
import models
import search as fastsearch
@@ -124,10 +125,14 @@ def feeds():
@app.route('/feed/<feed_id>', methods=['GET'])
@login_required
def feed(feed_id=None):
+ word_size = 5
user = models.User.objects(email=g.user.email, feeds__oid=feed_id).first()
for feed in user.feeds:
if str(feed.oid) == feed_id:
- return render_template('feed.html', feed=feed)
+ articles = feed.articles
+ top_words = utils.top_words(articles, n=50, size=int(word_size))
+ tag_cloud = utils.tag_cloud(top_words)
+ return render_template('feed.html', feed=feed, tag_cloud=tag_cloud)
@app.route('/article/<article_id>', methods=['GET'])
@login_required
bgstack15