diff --git a/rsshub/blueprints/main.py b/rsshub/blueprints/main.py index a667c67..84cbcea 100644 --- a/rsshub/blueprints/main.py +++ b/rsshub/blueprints/main.py @@ -139,4 +139,9 @@ def weiyangx_tag(category=''): @bp.route('/jintiankansha/column/') def jintiankansha_column(category=''): from rsshub.spiders.jintiankansha.column import ctx + return render_template('main/atom.xml', **filter_content(ctx(category))) + +@bp.route('/interotc/cpgg/') +def interotc_cpgg(category=''): + from rsshub.spiders.interotc.cpgg import ctx return render_template('main/atom.xml', **filter_content(ctx(category))) \ No newline at end of file diff --git a/rsshub/spiders/interotc/cpgg.py b/rsshub/spiders/interotc/cpgg.py new file mode 100644 index 0000000..9bd82c9 --- /dev/null +++ b/rsshub/spiders/interotc/cpgg.py @@ -0,0 +1,35 @@ +import requests +from rsshub.utils import DEFAULT_HEADERS + +domain = 'https://www.interotc.com.cn' + + +def parse(post): + item = {} + end_date = '' + if '东兴证券' in post['TITLE']: + end_date = post['CONTENT'].split('存续期到期日')[1].split('。')[0] + item['title'] = post['TITLE'] + ' (' + post['CPDM'] + ', ' + post['CPMC'] + ', ' + end_date + ')' + item['description'] = post['CONTENT'] + item['link'] = f'{domain}/portal/newportal/cpggDetail.html?bdid=' + str(post['BDID']) + item['pubDate'] = post['FBSJ'] + return item + + +def ctx(category=''): + DEFAULT_HEADERS.update({'Host': 'www.interotc.com.cn'}) + url = f'{domain}/zzjsInterface/interface/fixedIncome/lettersListNew.json' + # req_params = {'pageSize': '10','startDate':'-1', 'keyword': category, 'pageIndex': '1'} + # posts = requests.post(url, \ + # data=req_params, headers=DEFAULT_HEADERS) + req_params = f'?keyword={category}&pageSize=30' + posts = requests.get(url+req_params) + import json + posts = json.loads(posts.text)['resultSet'] + return { + 'title': f'{category} - 产品公告 - 机构间市场', + 'link': f'{domain}/portal/newportal/cpgg.html', + 'description': f'{category}的产品公告', + 'author': 'hillerliao', + 'items': list(map(parse, posts)) + } \ No newline at end of file diff --git a/rsshub/templates/main/feeds.html b/rsshub/templates/main/feeds.html index 70eb350..ae99559 100644 --- a/rsshub/templates/main/feeds.html +++ b/rsshub/templates/main/feeds.html @@ -253,4 +253,17 @@
+ +
+
+

产品公告 - 机构间市场

+
产品公告 - 机构间市场 by hillerliao
+

举例:https://pyrsshub.herokuapp.com/interotc/cpgg/东兴证券

+

路由:/interotc/cpgg/:category

+

参数:category [必填,标题中的关键词]

+
+
+
+ + {% endblock content %} \ No newline at end of file