def get_details_page_prefix(self):
pass
+ def get_headlines_page_priority(self):
+ return "4"
+
+ def get_details_page_priority(self):
+ return "6"
+
def should_use_https(self):
pass
def munge_image(self, image):
return image
+ def find_pubdate(self, item):
+ return item.findtext('pubDate')
+
+ def munge_pubdate(self, pubdate):
+ return pubdate
+
def item_is_interesting_for_headlines(self, title, description, item):
return True
def is_item_older_than_n_days(self, item, n):
- pubdate = item.findtext('pubDate')
+ pubdate = self.find_pubdate(item)
if pubdate is not None:
pubdate = parse(pubdate)
tzinfo = pubdate.tzinfo
headlines.set_custom_html("""
<STYLE>
a:link {
- color: maroon;
+ color: black;
text-decoration: none;
font-weight: bold;
}
a:visited {
- color: maroon;
+ color: black;
text-decoration: none;
font-weight: bold;
}
a:active {
- color: maroon;
+ color: black;
text-decoration: none;
font-weight: bold;
}
</STYLE>""")
- f = file_writer.file_writer('%s_4_none.html' % (
- self.get_headlines_page_prefix()))
+ f = file_writer.file_writer('%s_%s_none.html' % (
+ self.get_headlines_page_prefix(),
+ self.get_headlines_page_priority()))
headlines.render_html(f)
f.close()
details.set_custom_html("""
<STYLE>
a:link {
- color: maroon;
+ color: black;
text-decoration: none;
font-weight: bold;
}
a:visited {
- color: maroon;
+ color: black;
text-decoration: none;
font-weight: bold;
}
a:active {
- color: maroon;
+ color: black;
text-decoration: none;
font-weight: bold;
}
blurb = msg
blurb += u'</TD>'
details.add_item(blurb)
- g = file_writer.file_writer('%s_6_none.html' % (
- self.get_details_page_prefix()))
+ g = file_writer.file_writer('%s_%s_none.html' % (
+ self.get_details_page_prefix(),
+ self.get_details_page_priority()))
details.render_html(g)
g.close()
return True
self.debug_print('Found bad words in item "%s"' % title)
continue
- #print u"Title: %s\nDescription: %s\nLink: %s\nImage: %s\n" % (
- # title, description, link, image)
-
blurb = u"""<DIV style="padding:8px;
font-size:34pt;
-webkit-column-break-inside:avoid;">"""
else:
blurb += u'<P><B><A HREF="%s">%s</A></B>' % (link, title)
+ pubdate = self.find_pubdate(item)
+ if pubdate is not None:
+ pubdate = self.munge_pubdate(pubdate)
+ ts = parse(pubdate)
+ blurb += u" <FONT COLOR=#cccccc>%s</FONT>" % (
+ ts.strftime("%b %d"))
+
if (description is not None and
self.item_is_interesting_for_article(title,
description,
item)):
longblurb = blurb
+
longblurb += u"<BR>"
longblurb += description
longblurb += u"</DIV>"
var now = new Date();
var deltaMs = now.getTime() - loadedDate.getTime();
- // Reload unconditionally after 22 sec.
- if (deltaMs > %d) {
+ var totalMs = %d;
+ var remainingMs = (totalMs - deltaMs);
+ if (remainingMs > 0) {
+ var hr = document.getElementById("countdown");
+ var width = (remainingMs / totalMs) * 100.0;
+ hr.style.width = " ".concat(width, "%%");
+ hr.style.backgroundColor = "maroon";
+ } else {
+ // Reload unconditionally after 22 sec.
window.location.reload();
}
- // Reload immediately if told.
+ // Also reload immediately if told to do so.
var xhr = new XMLHttpRequest();
xhr.open('GET',
'http://wannabe.house/kiosk/pages/reload_immediately.html');
<P ALIGN="right">
<FONT SIZE=2 COLOR=#bbbbbb>%s @ %s ago.</FONT>
</P>
+ <HR id="countdown" STYLE="width:0px;
+ text-align:left;
+ border:none;
+ margin-top:0;
+ margin-left:0;
+ margin-bottom:2px;
+ height:5px;
+ background-color:#ffffff;">
</TD>
</TR>
</TABLE>