add symbol change history from nasdaq

This commit is contained in:
Hiller Liao
2025-03-25 22:58:51 +08:00
parent dd92fd2bd7
commit 38a33d7447
3 changed files with 48 additions and 0 deletions

View File

@@ -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/<string:lang>')
def futu_live(lang=''):
from rsshub.spiders.futu.live import ctx

View File

@@ -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)),
}

View File

@@ -42,6 +42,18 @@
<br>
<!--item info end-->
<!--item info start-->
<div class="card text-left">
<div class="card-body">
<h4 class="card-title">Symbol Change History - Nasdaq</h4>
<h6 class="text-muted">World Brief <a href="https://github.com/hillerliao" target="_blank" class="badge badge-secondary">by hillerliao</a></h6>
<p class="card-text">举例:<a href="https://pyrsshub.vercel.app/nasdaq/symbol_change" target="_blank">https://pyrsshub.vercel.app/nasdaq/symbol_change</a></p>
<p class="card-text">路由:<code>/nasdaq/symbol_change</code></p>
</div>
</div>
<br>
<!--item info end-->
<!--item info start-->
<div class="card text-left">
<div class="card-body">