安装与配置方法
- 先在 Mac 上安装并打开 Glanceway,再使用上方的安装链接。
- 点击“安装到 Glanceway”。如果浏览器无法唤起应用,下载 .gwsrc 文件并在信息源管理中导入。
- 填写下列必填字段并保存,设置刷新间隔,等待首次成功获取。
配置检查
STOCK_CODES— 必填. 股票代码(例如 600519, 000001, 300750) 每个值分别作为一条列表项添加。
填写六位沪深股票代码并保留开头的零。以 6 开头的代码映射到上海,其余映射到深圳。当前信息源没有实现港股代码映射。
配置示例
STOCK_CODES (list items):
600519
000001
300750 没有显示内容时如何排查
- 对照当前版本配置表核对字段、列表项和凭据。下方示例不包含可用的真实凭据。
- 检查网络与上游服务状态。认证失败或速率限制可能导致刷新失败,应根据上游限制调整间隔。
- 空列表也可能表示没有符合条件的条目。内容和更新时间取决于数据提供方及信息源实现。
配置项
| 名称 | 键 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|---|
| 股票代码 | STOCK_CODES | list | 是 | — | 股票代码(例如 600519, 000001, 300750) |
源代码
id: codytseng/cn-stock-price
version: 1.1.0
name: 股价监控
description: |
在菜单栏实时监控 A 股股价。
显示当前价格、涨跌额和涨跌幅。
author: codytseng
author_url: https://github.com/codytseng
category: Finance
tags:
- stock
- finance
- china
- a-share
config:
- key: STOCK_CODES
name: 股票代码
type: list
required: true
description: "股票代码(例如 600519, 000001, 300750)" id: codytseng/cn-stock-price
version: 1.1.0
name: 股价监控
description: |
在菜单栏实时监控 A 股股价。
显示当前价格、涨跌额和涨跌幅。
author: codytseng
author_url: https://github.com/codytseng
category: Finance
tags:
- stock
- finance
- china
- a-share
config:
- key: STOCK_CODES
name: 股票代码
type: list
required: true
description: "股票代码(例如 600519, 000001, 300750)" function toSecId(code) {
const c = code.trim();
// Shanghai: starts with 6
if (c.startsWith("6")) return `1.${c}`;
// Shenzhen: starts with 0 or 3
return `0.${c}`;
}
function marketLabel(market) {
return market === 1 ? "SH" : "SZ";
}
module.exports = async (api) => {
const codes = api.config.get("STOCK_CODES") ?? [];
async function fetchData() {
if (codes.length === 0) {
api.emit([]);
return;
}
const secIds = codes.map(toSecId).join(",");
const url = `https://push2.eastmoney.com/api/qt/ulist.np/get?secids=${secIds}&fields=f1,f2,f3,f4,f12,f13,f14`;
const response = await api.fetch(url);
if (!response.ok || !response.json?.data?.diff) {
throw new Error(
`Failed to fetch stock data (HTTP ${response.status})`,
);
}
const items = response.json.data.diff.map((stock) => {
const precision = stock.f1;
const divisor = Math.pow(10, precision);
const priceVal = stock.f2 / divisor;
const changeVal = stock.f4 / divisor;
const changePctVal = stock.f3 / divisor;
const arrow = changePctVal > 0 ? "↑" : changePctVal < 0 ? "↓" : "";
const sign = changePctVal > 0 ? "+" : "";
const ml = marketLabel(stock.f13);
const price = priceVal.toFixed(precision);
const change = changeVal.toFixed(precision);
const changePct = changePctVal.toFixed(2);
return {
id: `${ml}${stock.f12}`,
title: `${stock.f14} (${ml}${stock.f12})`,
subtitle: `${price} ${arrow} ${sign}${change} (${sign}${changePct}%)`,
tickerText: `${stock.f14} ${price} ${sign}${changePct}%`,
url: `https://quote.eastmoney.com/${ml.toLowerCase()}${stock.f12}.html`,
};
});
api.emit(items);
}
await fetchData();
return {
refresh: fetchData,
};
}; function toSecId(code) {
const c = code.trim();
// Shanghai: starts with 6
if (c.startsWith("6")) return `1.${c}`;
// Shenzhen: starts with 0 or 3
return `0.${c}`;
}
function marketLabel(market) {
return market === 1 ? "SH" : "SZ";
}
module.exports = async (api) => {
const codes = api.config.get("STOCK_CODES") ?? [];
async function fetchData() {
if (codes.length === 0) {
api.emit([]);
return;
}
const secIds = codes.map(toSecId).join(",");
const url = `https://push2.eastmoney.com/api/qt/ulist.np/get?secids=${secIds}&fields=f1,f2,f3,f4,f12,f13,f14`;
const response = await api.fetch(url);
if (!response.ok || !response.json?.data?.diff) {
throw new Error(
`Failed to fetch stock data (HTTP ${response.status})`,
);
}
const items = response.json.data.diff.map((stock) => {
const precision = stock.f1;
const divisor = Math.pow(10, precision);
const priceVal = stock.f2 / divisor;
const changeVal = stock.f4 / divisor;
const changePctVal = stock.f3 / divisor;
const arrow = changePctVal > 0 ? "↑" : changePctVal < 0 ? "↓" : "";
const sign = changePctVal > 0 ? "+" : "";
const ml = marketLabel(stock.f13);
const price = priceVal.toFixed(precision);
const change = changeVal.toFixed(precision);
const changePct = changePctVal.toFixed(2);
return {
id: `${ml}${stock.f12}`,
title: `${stock.f14} (${ml}${stock.f12})`,
subtitle: `${price} ${arrow} ${sign}${change} (${sign}${changePct}%)`,
tickerText: `${stock.f14} ${price} ${sign}${changePct}%`,
url: `https://quote.eastmoney.com/${ml.toLowerCase()}${stock.f12}.html`,
};
});
api.emit(items);
}
await fetchData();
return {
refresh: fetchData,
};
}; id: codytseng/cn-stock-price
version: 1.0.0
name: 股价监控
description: |
在菜单栏实时监控 A 股股价。
显示当前价格、涨跌额和涨跌幅。
author: codytseng
author_url: https://github.com/codytseng
category: Finance
tags:
- stock
- finance
- china
- a-share
config:
- key: STOCK_CODES
name: 股票代码
type: list
required: true
description: "股票代码(例如 600519, 000001, 300750)" id: codytseng/cn-stock-price
version: 1.0.0
name: 股价监控
description: |
在菜单栏实时监控 A 股股价。
显示当前价格、涨跌额和涨跌幅。
author: codytseng
author_url: https://github.com/codytseng
category: Finance
tags:
- stock
- finance
- china
- a-share
config:
- key: STOCK_CODES
name: 股票代码
type: list
required: true
description: "股票代码(例如 600519, 000001, 300750)" function toSecId(code) {
const c = code.trim();
// Shanghai: starts with 6
if (c.startsWith("6")) return `1.${c}`;
// Shenzhen: starts with 0 or 3
return `0.${c}`;
}
function marketLabel(market) {
return market === 1 ? "SH" : "SZ";
}
module.exports = async (api) => {
const codes = api.config.get("STOCK_CODES") ?? [];
async function fetchData() {
if (codes.length === 0) {
api.emit([]);
return;
}
const secIds = codes.map(toSecId).join(",");
const url = `https://push2.eastmoney.com/api/qt/ulist.np/get?secids=${secIds}&fields=f1,f2,f3,f4,f12,f13,f14`;
const response = await api.fetch(url);
if (!response.ok || !response.json?.data?.diff) {
throw new Error(
`Failed to fetch stock data (HTTP ${response.status})`,
);
}
const items = response.json.data.diff.map((stock) => {
const precision = stock.f1;
const divisor = Math.pow(10, precision);
const priceVal = stock.f2 / divisor;
const changeVal = stock.f4 / divisor;
const changePctVal = stock.f3 / divisor;
const arrow = changePctVal > 0 ? "↑" : changePctVal < 0 ? "↓" : "";
const sign = changePctVal > 0 ? "+" : "";
const ml = marketLabel(stock.f13);
const price = priceVal.toFixed(precision);
const change = changeVal.toFixed(precision);
const changePct = changePctVal.toFixed(2);
return {
id: `${ml}${stock.f12}`,
title: `${stock.f14} (${ml}${stock.f12})`,
subtitle: `${price} ${arrow} ${sign}${change} (${sign}${changePct}%)`,
url: `https://quote.eastmoney.com/${ml.toLowerCase()}${stock.f12}.html`,
};
});
api.emit(items);
}
await fetchData();
return {
refresh: fetchData,
};
}; function toSecId(code) {
const c = code.trim();
// Shanghai: starts with 6
if (c.startsWith("6")) return `1.${c}`;
// Shenzhen: starts with 0 or 3
return `0.${c}`;
}
function marketLabel(market) {
return market === 1 ? "SH" : "SZ";
}
module.exports = async (api) => {
const codes = api.config.get("STOCK_CODES") ?? [];
async function fetchData() {
if (codes.length === 0) {
api.emit([]);
return;
}
const secIds = codes.map(toSecId).join(",");
const url = `https://push2.eastmoney.com/api/qt/ulist.np/get?secids=${secIds}&fields=f1,f2,f3,f4,f12,f13,f14`;
const response = await api.fetch(url);
if (!response.ok || !response.json?.data?.diff) {
throw new Error(
`Failed to fetch stock data (HTTP ${response.status})`,
);
}
const items = response.json.data.diff.map((stock) => {
const precision = stock.f1;
const divisor = Math.pow(10, precision);
const priceVal = stock.f2 / divisor;
const changeVal = stock.f4 / divisor;
const changePctVal = stock.f3 / divisor;
const arrow = changePctVal > 0 ? "↑" : changePctVal < 0 ? "↓" : "";
const sign = changePctVal > 0 ? "+" : "";
const ml = marketLabel(stock.f13);
const price = priceVal.toFixed(precision);
const change = changeVal.toFixed(precision);
const changePct = changePctVal.toFixed(2);
return {
id: `${ml}${stock.f12}`,
title: `${stock.f14} (${ml}${stock.f12})`,
subtitle: `${price} ${arrow} ${sign}${change} (${sign}${changePct}%)`,
url: `https://quote.eastmoney.com/${ml.toLowerCase()}${stock.f12}.html`,
};
});
api.emit(items);
}
await fetchData();
return {
refresh: fetchData,
};
}; 相关信息源
CoinGecko Crypto Markets
财经Top cryptocurrencies by market cap from CoinGecko
#crypto #finance #markets
Finnhub Market News
财经Financial news aggregated from major sources like Yahoo, Reuters, and CNBC via Finnhub
#finance #news #market #stocks
Stock Price Monitor
财经Monitor global stock prices in your menu bar. Displays real-time price, change amount, and change percentage. Powered by Finnhub (free API key required).
#stock #finance #market
华尔街见闻
财经华尔街见闻 7x24 快讯
#finance #news #chinese #market