mirror of
https://github.com/d0zingcat/RSSHub-python.git
synced 2026-05-14 15:09:23 +00:00
add jintiankansha
This commit is contained in:
@@ -134,4 +134,9 @@ def weiyangx_express():
|
||||
@bp.route('/weiyangx/tag/<string:category>')
|
||||
def weiyangx_tag(category=''):
|
||||
from rsshub.spiders.weiyangx.tag import ctx
|
||||
return render_template('main/atom.xml', **filter_content(ctx(category)))
|
||||
return render_template('main/atom.xml', **filter_content(ctx(category)))
|
||||
|
||||
@bp.route('/jintiankansha/column/<string:category>')
|
||||
def jintiankansha_column(category=''):
|
||||
from rsshub.spiders.jintiankansha.column import ctx
|
||||
return render_template('main/atom.xml', **filter_content(ctx(category)))
|
||||
27
rsshub/spiders/jintiankansha/column.py
Normal file
27
rsshub/spiders/jintiankansha/column.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from rsshub.utils import DEFAULT_HEADERS
|
||||
from rsshub.utils import fetch
|
||||
|
||||
domain = 'http://www.jintiankansha.me'
|
||||
|
||||
|
||||
def parse(post):
|
||||
item = {}
|
||||
item['description'] = item['title'] = post.css('a::text').extract_first()
|
||||
item['link'] = post.css('a::attr(href)').extract_first()
|
||||
return item
|
||||
|
||||
|
||||
def ctx(category=''):
|
||||
url = f'{domain}/column/{category}'
|
||||
tree = fetch(url, headers=DEFAULT_HEADERS)
|
||||
posts = tree.css('.cell.item')
|
||||
items = list(map(parse, posts))
|
||||
|
||||
column_title = tree.css('title::text').extract_first()
|
||||
return {
|
||||
'title': f'{column_title}',
|
||||
'description': f'{category}',
|
||||
'link': url,
|
||||
'author': f'hillerliao',
|
||||
'items': items
|
||||
}
|
||||
Reference in New Issue
Block a user