Archived
1
0
Fork 0
This repository has been archived on 2024-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
akari-bot/modules/weekly/teahouse.py

16 lines
505 B
Python
Raw Normal View History

2021-11-19 17:50:34 +00:00
import feedparser
from core.html2text import html2text
2021-11-19 17:50:34 +00:00
from core.utils.bot import get_url
async def get_rss():
"""
Get RSS feed from lakeus.xyz
"""
url = await get_url('https://lakeus.xyz/api.php?action=featuredfeed&feed=teahouse-weekly&feedformat=atom',
status_code=200, fmt='text')
feed = feedparser.parse(url)['entries'][-1]
title = feed['title']
summary = html2text(feed['summary'], baseurl='https://lakeus.xyz')
2021-11-19 17:50:34 +00:00
return title + '\n' + summary