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>"