diff --git a/rsshub/blueprints/main.py b/rsshub/blueprints/main.py index 7664c67..a62c913 100644 --- a/rsshub/blueprints/main.py +++ b/rsshub/blueprints/main.py @@ -248,6 +248,11 @@ def economist_wordlbrief(category=''): from rsshub.spiders.economist.worldbrief import ctx return render_template('main/atom.xml', **filter_content(ctx(category))) +@bp.route('/nasdaq/symbol_change') +def nasdaq_symbol_change(category=''): + from rsshub.spiders.nasdaq.symbol_change import ctx + return render_template('main/atom.xml', **filter_content(ctx(category))) + @bp.route('/futu/live/') def futu_live(lang=''): from rsshub.spiders.futu.live import ctx diff --git a/rsshub/spiders/nasdaq/symbol_change.py b/rsshub/spiders/nasdaq/symbol_change.py new file mode 100644 index 0000000..e9ec7e3 --- /dev/null +++ b/rsshub/spiders/nasdaq/symbol_change.py @@ -0,0 +1,31 @@ +import json +import requests +from rsshub.utils import DEFAULT_HEADERS + +domain = 'https://api.nasdaq.com' + + +def parse(post): + item = {} + item['title'] = post['effective'] + ',' + post['oldSymbol'] + ' -> ' + post['newSymbol'] + item['description'] = item['title'] + '。公司:' + post['companyName'] + item['link'] = post['url'] + return item + + +def ctx(category=''): + url = f'https://www.nasdaq.com/market-activity/stocks/symbol-change-history' + DEFAULT_HEADERS.update({'Referer': f'https://www.chaindd.com/column/{category}'}) + print(url) + posts = requests.get( + url, + headers=DEFAULT_HEADERS, + ).text + posts = json.loads(posts)['data']['rows'] + return { + 'title': 'Stock Symbol Change History - Nasdaq', + 'link': f'https://www.nasdaq.com/market-activity/stocks/symbol-change-history', + 'description': 'View the history of stock symbol changes on Nasdaq. Stay informed on corporate actions, mergers, and rebrandings that result in symbol updates', + 'author': 'hillerliao', + 'items': list(map(parse, posts)), + } diff --git a/rsshub/templates/main/feeds.html b/rsshub/templates/main/feeds.html index 5599dda..8dc0645 100644 --- a/rsshub/templates/main/feeds.html +++ b/rsshub/templates/main/feeds.html @@ -42,6 +42,18 @@
+ +
+
+

Symbol Change History - Nasdaq

+
World Brief by hillerliao
+

举例:https://pyrsshub.vercel.app/nasdaq/symbol_change

+

路由:/nasdaq/symbol_change

+
+
+
+ +