summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--unbiased/html_template/unbiased.jinja.html12
-rw-r--r--unbiased/unbiasedFunctions.py6
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 @@
<div class="top-story">
<a target="_blank" onclick="window.open('{{ story.url }}', '_blank')">
- <div class="top-stories-img" style="background-image: url('{{ story.img }}');" /></div>
- <div class="top-stories-hed">{{ story.title|safe }}</div>
+ <div class="top-stories-img" style="background-image: url('{{ story.img }}?{{ utime }}');" /></div>
+ <div class="top-stories-hed">{{ story.title }}</div>
</a>
- <div class="top-stories-desc">{{ story.description|safe|truncate(140) }}</div>
+ <div class="top-stories-desc">{{ story.description }}</div>
</div>
{% endfor %}
@@ -45,8 +45,8 @@
<div class="middle-story">
<a target="_blank" onclick="window.open('{{ story.url }}', '_blank')">
<p>
- <div class="middle-stories-img" style="background-image: url('{{ story.img }}');"></div>
- {{ story.title|safe }}
+ <div class="middle-stories-img" style="background-image: url('{{ story.img }}?{{ utime }}');"></div>
+ {{ story.title }}
</p>
</a>
</div>
@@ -62,7 +62,7 @@
{% for story in bottom_stories %}
<div class="bottom-story">
- <a target="_blank" onclick="window.open('{{ story.url }}', '_blank')">{{ story.title|safe }}</a>
+ <a target="_blank" onclick="window.open('{{ story.url }}', '_blank')">{{ story.title }}</a>
</div>
{% 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,