format cls timestamp string

This commit is contained in:
hillerliao
2022-05-15 22:47:56 +08:00
parent efd3e43d53
commit d6d7b7f3c4
6 changed files with 27 additions and 7 deletions

View File

@@ -1,14 +1,14 @@
import requests
import feedparser
import arrow
from rsshub.utils import DEFAULT_HEADERS
from rsshub.utils import fetch
def parse(post):
item = {}
item['title'] = post.title
item['description'] = post.summary
item['pubDate'] = post.published if post.has_key('published') else ''
item['pubDate'] = post.published if post.has_key('published') else arrow.now().isoformat()
item['link'] = post.link
item['author'] = post.author if post.has_key('author') else ''
return item