mirror of
https://github.com/d0zingcat/RSSHub-python.git
synced 2026-05-23 07:26:47 +00:00
add cninfo announcement
This commit is contained in:
@@ -1,23 +1,23 @@
|
||||
from rsshub.utils import fetch
|
||||
|
||||
domain = 'https://www.ctolib.com'
|
||||
|
||||
|
||||
def parse(post):
|
||||
item = {}
|
||||
item['title'] = post.css('a.title::text').extract_first()
|
||||
item['description'] = post.css('p.abstract::text').extract_first()
|
||||
item['link'] = f"{domain}{post.css('a.title::attr(href)').extract_first()}"
|
||||
return item
|
||||
|
||||
|
||||
def ctx(category=''):
|
||||
tree = fetch(f'{domain}/python/topics/{category}')
|
||||
posts = tree.css('ul.note-list li')
|
||||
return {
|
||||
'title': 'CTOLib码库',
|
||||
'link': domain,
|
||||
'description': 'Python开发社区',
|
||||
'author': 'alphardex',
|
||||
'items': list(map(parse, posts))
|
||||
from rsshub.utils import fetch
|
||||
|
||||
domain = 'https://www.ctolib.com'
|
||||
|
||||
|
||||
def parse(post):
|
||||
item = {}
|
||||
item['title'] = post.css('a.title::text').extract_first()
|
||||
item['description'] = post.css('p.abstract::text').extract_first()
|
||||
item['link'] = f"{domain}{post.css('a.title::attr(href)').extract_first()}"
|
||||
return item
|
||||
|
||||
|
||||
def ctx(category=''):
|
||||
tree = fetch(f'{domain}/python/topics/{category}')
|
||||
posts = tree.css('ul.note-list li')
|
||||
return {
|
||||
'title': 'CTOLib码库',
|
||||
'link': domain,
|
||||
'description': 'Python开发社区',
|
||||
'author': 'alphardex',
|
||||
'items': list(map(parse, posts))
|
||||
}
|
||||
Reference in New Issue
Block a user