entry["author"]
except:
entry["author"] = None
+ if(not(entry.has_key("id"))):
+ entry["id"] = None
tmpEntry = {"title":entry["title"], "content":self.extractContent(entry),
- "date":date, "link":entry["link"], "author":entry["author"]}
+ "date":date, "link":entry["link"], "author":entry["author"], "id":entry["id"]}
id = self.generateUniqueId(tmpEntry)
#articleTime = time.mktime(self.entries[id]["dateTuple"])
return self.db.execute("SELECT date FROM feed WHERE id=?;", (id,) ).fetchone()[0]
def generateUniqueId(self, entry):
- return getId(str(entry["date"]) + str(entry["title"]))
+ if(entry["id"] != None):
+ return getId(str(entry["id"]))
+ else:
+ return getId(str(entry["date"]) + str(entry["title"]))
def getIds(self, onlyUnread=False):
if onlyUnread:
text += "<html><head><title>" + title + "</title>"
text += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>\n'
#text += '<style> body {-webkit-user-select: none;} </style>'
- text += '</head><body><div><a href=\"' + link + '\">' + title + "</a>"
+ text += '</head><body background=\"white\"><div><a href=\"' + link + '\">' + title + "</a>"
if author != None:
text += "<BR /><small><i>Author: " + author + "</i></small>"
text += "<BR /><small><i>Date: " + date + "</i></small></div>"
return keys
def getCategoryTitle(self, id):
- print id
row = self.db.execute("SELECT title FROM categories WHERE id=?;", (id, )).fetchone()
return row[0]