|
|
|
@ -48,7 +48,7 @@ class Publications(Bureau):
|
|
|
|
|
res = "not None"
|
|
|
|
|
while res is not None:
|
|
|
|
|
tmpcode = _shortcode()
|
|
|
|
|
res = txn.get(tmpcode)
|
|
|
|
|
res = txn.get(tmpcode.encode())
|
|
|
|
|
txn.put(tmpcode.encode(), url.encode())
|
|
|
|
|
|
|
|
|
|
return tmpcode
|
|
|
|
@ -99,6 +99,7 @@ class Publications(Bureau):
|
|
|
|
|
# TODO: get weather
|
|
|
|
|
# TODO: get finance
|
|
|
|
|
inbox = self.send("PO", "unread")
|
|
|
|
|
print("news", news[0])
|
|
|
|
|
self.print_full("news.html", news=news, inbox=inbox)
|
|
|
|
|
|
|
|
|
|
@add_command("r", "Print a web page for reading")
|
|
|
|
@ -173,6 +174,10 @@ class Publications(Bureau):
|
|
|
|
|
entry = feed.entries.pop()
|
|
|
|
|
entry.source = feed.feed.title
|
|
|
|
|
entry.dbhash = self._make_shorturl(entry.link)
|
|
|
|
|
if hasattr(entry, "media_thumbnail"):
|
|
|
|
|
entry.img = entry.media_thumbnail[-1]["url"]
|
|
|
|
|
else:
|
|
|
|
|
entry.img = " "
|
|
|
|
|
|
|
|
|
|
# limit summary to the last space below 500 characters
|
|
|
|
|
if len(entry.summary) > 500:
|
|
|
|
|