From 3858bb065db14c925bf190240bf707c32daef73a Mon Sep 17 00:00:00 2001 From: cedricbonhomme Date: Tue, 22 Feb 2011 18:56:59 +0100 Subject: Improvement on the feed page. Tag cloud of the most frequent words of a feed. --- pyAggr3g470r.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'pyAggr3g470r.py') diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py index 3d52f704..40214fa5 100755 --- a/pyAggr3g470r.py +++ b/pyAggr3g470r.py @@ -517,7 +517,7 @@ class Root: article.exposed = True - def feed(self, feed_id): + def feed(self, feed_id, word_size=6): """ This page gives summary informations about a feed. """ @@ -590,6 +590,18 @@ class Root: html += article.article_date + " - " + \ """%s%s
\n""" % \ (feed.feed_id, article.article_id, article.article_title[:150], description) + dic = {} + dic[feed.feed_id] = self.feeds[feed.feed_id] + top_words = utils.top_words(dic, n=50, size=int(word_size)) + html += "

Tag cloud

\n
\n" + # Tags cloud + html += 'Minimum size of a word:' + html += '
' + html += """""" % (word_size) + html += '
\n' + html += '
' + \ + utils.tag_cloud(top_words) + '
' + html += "
" html += htmlfooter return html -- cgit