diff options
author | cedricbonhomme <devnull@localhost> | 2010-11-23 11:55:18 +0100 |
---|---|---|
committer | cedricbonhomme <devnull@localhost> | 2010-11-23 11:55:18 +0100 |
commit | 65843b3e0c16c8b4a360c8ec7a2795af2b49ae73 (patch) | |
tree | ae87d061a97ccf1e62dd9b46687420a714dead10 | |
parent | Improvement of mail notification for new articles (HTML output). (diff) | |
download | newspipe-65843b3e0c16c8b4a360c8ec7a2795af2b49ae73.tar.gz newspipe-65843b3e0c16c8b4a360c8ec7a2795af2b49ae73.tar.bz2 newspipe-65843b3e0c16c8b4a360c8ec7a2795af2b49ae73.zip |
Improvement of the search results (ToolTips, display).
-rwxr-xr-x | pyAggr3g470r.py | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py index ee16f025..6174945f 100755 --- a/pyAggr3g470r.py +++ b/pyAggr3g470r.py @@ -393,11 +393,26 @@ class Root: not_read_begin = "" not_read_end = "" - html += article[1].encode('utf-8') + \ - " - " + not_read_begin + \ - """<a href="/description/%s:%s" rel="noreferrer" target="_blank">%s</a>""" % \ - (rss_feed_id, article[0].encode('utf-8'), article[2].encode('utf-8')) + \ - not_read_end + """<br />\n""" + # display a heart for faved articles + if article[7] == "1": + like = """ <img src="/css/img/heart.png" title="I like this article!" />""" + else: + like = "" + + # descrition for the CSS ToolTips + article_content = utils.clear_string(article[4].encode('utf-8')) + if article_content: + description = " ".join(article_content[:500].split(' ')[:-1]) + else: + description = "No description." + + # a description line per article (date, title of the article and + # CSS description tooltips on mouse over) + html += article[1].encode('utf-8') + " - " + \ + """<a class="tooltip" href="/description/%s:%s" rel="noreferrer" target="_blank">%s%s%s<span class="classic">%s</span></a>""" % \ + (rss_feed_id, article[0].encode('utf-8'), not_read_begin, \ + article[2].encode('utf-8')[:150], \ + not_read_end, description) + like + "<br />\n" html += "<hr />" html += htmlfooter return html |