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
2021-11-20 22:47:22 +08:00

15 lines
495 B
Python

import feedparser
import html2text
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.html2text(feed['summary'], baseurl='https://lakeus.xyz')
return title + '\n' + summary