Formatted-RSS-to-Telegram/FR2T/parser.py

15 lines
247 B
Python
Raw Normal View History

2021-05-26 09:32:39 +00:00
import feedparser
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