From 1c825c79a17f9ba1e7c81668921c87ccecd672d3 Mon Sep 17 00:00:00 2001 From: Matt Singleton Date: Sun, 23 Apr 2017 05:33:23 -0400 Subject: tweak the rendering --- unbiased/html_template/unbiased.jinja.html | 12 ++++++------ unbiased/unbiasedFunctions.py | 6 ++++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/unbiased/html_template/unbiased.jinja.html b/unbiased/html_template/unbiased.jinja.html index fcca97f..4a07d0b 100644 --- a/unbiased/html_template/unbiased.jinja.html +++ b/unbiased/html_template/unbiased.jinja.html @@ -24,10 +24,10 @@
-
-
{{ story.title|safe }}
+
+
{{ story.title }}
-
{{ story.description|safe|truncate(140) }}
+
{{ story.description }}
{% endfor %} @@ -45,8 +45,8 @@

-

- {{ story.title|safe }} +
+ {{ story.title }}

@@ -62,7 +62,7 @@ {% for story in bottom_stories %}
- {{ story.title|safe }} + {{ story.title }}
{% endfor %} diff --git a/unbiased/unbiasedFunctions.py b/unbiased/unbiasedFunctions.py index 46dae19..cb13a44 100644 --- a/unbiased/unbiasedFunctions.py +++ b/unbiased/unbiasedFunctions.py @@ -131,7 +131,7 @@ def buildArticle(url, sourceName, encoding=None):#, titleDelStart, titleDelEnd, logger.debug(description) - a=Article(title, url, img, description, sourceName, author) + a=Article(html.unescape(title), url, img, html.unescape(description), sourceName, html.unescape(author)) return a except Exception: @@ -209,12 +209,14 @@ def buildOutput(top_stories, middle_stories, bottom_stories): ) template = env.get_template('unbiased.jinja.html') - timestamp=time.strftime("%a, %b %-d, %-I:%M%P %Z", time.localtime()) + timestamp = time.strftime("%a, %b %-d, %-I:%M%P %Z", time.localtime()) + utime = int(time.time()) sourcesStr = ', '.join(set([x.source for x in top_stories] + [x.source for x in middle_stories] + [x.source for x in bottom_stories])) html = template.render( timestamp = timestamp, + utime = utime, top_stories = top_stories, middle_stories = middle_stories, bottom_stories = bottom_stories, -- cgit v1.2.3