def get_tiles(self): user = self.get_prop('username') password = self.get_prop('password') rawfeed = get_unread_msgs_atom(user, password) f = feedparser.parse(rawfeed) tiles = [] for entry in f.entries: t = Tile() t.title = entry.title.encode("utf-8").decode("utf-8") t.module = self.module t.text = entry.summary.encode("utf-8").decode("utf-8") t.link = entry.link.encode("utf-8").decode("utf-8") t.date = datetime.fromtimestamp(mktime(entry.issued_parsed)) tiles.append(t) return tiles
def get_tiles(self): rawfeed = self.get_feed() f = feedparser.parse(rawfeed) tiles = [] count = 0 for i in f.entries: count = count + 1 if (count < MAX_TILES): t = Tile() t.title = "Download Complete" t.module = self.module t.text = i.title t.link = self.get_prop('host') t.date = datetime.fromtimestamp(mktime(i.published_parsed)) print i.title + " - " + str(i.published_parsed) tiles.append(t) return tiles