Ejemplo n.º 1
0
def generate_item(msg):
    fe = FeedEntry()
    fe.author(msg.sent_from)
    fe.pubDate(msg.date)
    fe.title(msg.subject)
    # print(f"{fe.title()} - {fe.pubDate()}")
    content = msg.body.get("html")
    fe.description(content, isSummary=True)
    return fe
Ejemplo n.º 2
0
    def update_article(self, article: Article):
        fe = FeedEntry()
        fe.id(article.link)
        fe.link(href=article.link)
        fe.title(article.title)
        fe.description(article.description)
        fe.pubDate(article.date.replace(tzinfo=gettz("Asia/Shanghai")))
        self.fg.entry(fe, replace=True)

        self.fg.updated()