mirror of
https://github.com/d0zingcat/RSSHub-python.git
synced 2026-05-19 15:09:37 +00:00
fetch dxzg notice
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -14,4 +14,6 @@ venv
|
|||||||
.vscode
|
.vscode
|
||||||
.coverage
|
.coverage
|
||||||
htmlcov/
|
htmlcov/
|
||||||
data-dev.db
|
data-dev.db
|
||||||
|
|
||||||
|
.env
|
||||||
@@ -57,3 +57,8 @@ def ctolib_topics(category=''):
|
|||||||
def infoq_recommend():
|
def infoq_recommend():
|
||||||
from rsshub.spiders.infoq.recommend import ctx
|
from rsshub.spiders.infoq.recommend import ctx
|
||||||
return render_template('main/atom.xml', **filter_content(ctx()))
|
return render_template('main/atom.xml', **filter_content(ctx()))
|
||||||
|
|
||||||
|
@bp.route('/dxzg/notice')
|
||||||
|
def dxzg_notice():
|
||||||
|
from rsshub.spiders.dxzg.notice import ctx
|
||||||
|
return render_template('main/atom.xml', **filter_content(ctx()))
|
||||||
|
|||||||
24
rsshub/spiders/dxzg/notice.py
Normal file
24
rsshub/spiders/dxzg/notice.py
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
from rsshub.utils import fetch
|
||||||
|
|
||||||
|
domain = 'http://www.dxzq.net'
|
||||||
|
|
||||||
|
|
||||||
|
def parse(post):
|
||||||
|
item = {}
|
||||||
|
item['description'] = item['title'] = post.css('a::text').extract_first()
|
||||||
|
link = f"{domain}{post.css('a::attr(href)').extract_first()}"
|
||||||
|
item['link'] = link
|
||||||
|
item['pubDate'] = post.css('span.time::text').extract_first()
|
||||||
|
return item
|
||||||
|
|
||||||
|
|
||||||
|
def ctx(category=''):
|
||||||
|
tree = fetch(f"{domain}/main/zcgl/zxgg/index.shtml?catalogId=1,5,228")
|
||||||
|
posts = tree.css('.news_list li')
|
||||||
|
return {
|
||||||
|
'title': '东兴资管产品最新公告',
|
||||||
|
'link': domain,
|
||||||
|
'description': '东兴资管产品最新公告',
|
||||||
|
'author': 'hillerliao',
|
||||||
|
'items': list(map(parse, posts))
|
||||||
|
}
|
||||||
@@ -74,4 +74,15 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
|
<!--item info start-->
|
||||||
|
<div class="card text-left">
|
||||||
|
<div class="card-body">
|
||||||
|
<h4 class="card-title">东兴资管</h4>
|
||||||
|
<h6 class="text-muted">产品公告 <a href="https://github.com/hillerliao" target="_blank" class="badge badge-secondary">by hillerliao</a></h6>
|
||||||
|
<p class="card-text">举例:<a href="https://rsshub-python.herokuapp.com/dxzg/notice" target="_blank">https://rsshub-python.herokuapp.com/dxzg/notice</a></p>
|
||||||
|
<p class="card-text">路由:<code>/dxzg/notice</code></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<br>
|
||||||
|
<!--item info end-->
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
Reference in New Issue
Block a user