2021-05-26 09:32:39 +00:00
|
|
|
import feedparser
|
|
|
|
|
|
|
|
|
2021-05-27 09:32:21 +00:00
|
|
|
def rssParser(url: str, user_agent: str):
|
2021-05-27 10:31:26 +00:00
|
|
|
return feedparser.parse(url, agent=user_agent)["entries"]
|
2021-05-26 09:32:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
def objParser(obj: dict, url: str):
|
|
|
|
paths = url.split(".")
|
|
|
|
|
|
|
|
for p in paths:
|
|
|
|
obj = obj[p]
|
|
|
|
|
|
|
|
return obj
|