aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcedricbonhomme <devnull@localhost>2011-02-22 18:56:59 +0100
committercedricbonhomme <devnull@localhost>2011-02-22 18:56:59 +0100
commit3858bb065db14c925bf190240bf707c32daef73a (patch)
tree3d57006af2beea7c2840262781d680037ebd2085
parentImprovement on the feed page. Only displays favs when there is. (diff)
downloadnewspipe-3858bb065db14c925bf190240bf707c32daef73a.tar.gz
newspipe-3858bb065db14c925bf190240bf707c32daef73a.tar.bz2
newspipe-3858bb065db14c925bf190240bf707c32daef73a.zip
Improvement on the feed page. Tag cloud of the most frequent words of a feed.
-rwxr-xr-xpyAggr3g470r.py14
1 files changed, 13 insertions, 1 deletions
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 + " - " + \
"""<a class="tooltip" href="/article/%s:%s" rel="noreferrer" target="_blank">%s<span class="classic">%s</span></a><br />\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 += "<br /></br /><h1>Tag cloud</h1>\n<br />\n"
+ # Tags cloud
+ html += 'Minimum size of a word:'
+ html += '<form method=get action="/management/">'
+ html += """<input type="number" name="word_size" value="%s" min="2" max="15" step="1" size="2">""" % (word_size)
+ html += '<input type="submit" value="OK"></form>\n'
+ html += '<div style="width: 35%; overflow:hidden; text-align: justify">' + \
+ utils.tag_cloud(top_words) + '</div>'
+
html += "<hr />"
html += htmlfooter
return html
bgstack15