mirror of
https://github.com/d0zingcat/RSSHub-python.git
synced 2026-06-10 15:10:45 +00:00
get symbol change history from nasdaq
This commit is contained in:
@@ -8,23 +8,25 @@ domain = 'https://api.nasdaq.com'
|
||||
def parse(post):
|
||||
item = {}
|
||||
item['title'] = post['effective'] + ',' + post['oldSymbol'] + ' -> ' + post['newSymbol']
|
||||
item['description'] = item['title'] + '。公司:' + post['companyName']
|
||||
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']
|
||||
url = 'https://api.nasdaq.com/api/quote/list-type-extended/symbolchangehistory'
|
||||
DEFAULT_HEADERS.update({
|
||||
'Referer': 'https://www.nasdaq.com/',
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
|
||||
})
|
||||
|
||||
response = requests.get(url, headers=DEFAULT_HEADERS)
|
||||
response.raise_for_status() # 确保请求成功
|
||||
posts = json.loads(response.text)['data']['symbolChangeHistoryTable']['rows']
|
||||
|
||||
return {
|
||||
'title': 'Stock Symbol Change History - Nasdaq',
|
||||
'link': f'https://www.nasdaq.com/market-activity/stocks/symbol-change-history',
|
||||
'link': '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)),
|
||||
|
||||
Reference in New Issue
Block a user