mirror of
https://github.com/d0zingcat/RSSHub-python.git
synced 2026-05-14 15:09:23 +00:00
add chaindd column
This commit is contained in:
24
rsshub/spiders/chaindd/column.py
Normal file
24
rsshub/spiders/chaindd/column.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from rsshub.utils import fetch
|
||||
|
||||
domain = 'https://www.chaindd.com'
|
||||
|
||||
|
||||
def parse(post):
|
||||
item = {}
|
||||
item['title'] = post.css('a::text').extract_first()
|
||||
item['description'] = post.css('p::text').extract_first()
|
||||
item['link'] = f"{domain}{post.css('a::attr(href)').extract_first()}"
|
||||
item['author'] = post.css('a.name::text').extract_first()
|
||||
return item
|
||||
|
||||
|
||||
def ctx(category=''):
|
||||
tree = fetch(f"{domain}/column/{category}")
|
||||
posts = tree.css('li .cont')
|
||||
return {
|
||||
'title': f'链得得栏目{category}最新文章',
|
||||
'link': f'{domain}/column/{category}',
|
||||
'description': f'链得得栏目{category}最新文章',
|
||||
'author': 'hillerliao',
|
||||
'items': list(map(parse, posts))
|
||||
}
|
||||
Reference in New Issue
Block a user