add-fetcher
星标0
分支0
更新时间2026年4月12日 15:28
Add a new stock market fetcher to the kabuka project
安装
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
SKILL.md
readonly菜单
Add a new stock market fetcher to the kabuka project
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
| name | add-fetcher |
| description | Add a new stock market fetcher to the kabuka project |
| disable-model-invocation | true |
Add a new market fetcher for: $ARGUMENTS
Steps:
Identify the exact market name string Yahoo Finance uses in the DOM — inspect the element targeted by selectorMarketNameSingle in fetcher/fetcher.go on a real Yahoo Finance page for that market.
Create internal/app/kabuka/fetcher/<market>/ with a <market>_fetcher.go file. Use fetcher/jp/jp_fetcher.go as the reference implementation.
Implement the Fetcher interface:
IsMarket(doc *goquery.Document) bool — use fetcher.GetMarketName(doc) and match against the market name(s) identified in step 1Fetch(doc *goquery.Document, symbol string) (*model.Stock, error) — extract price using doc.Find(selectorCurrentPrice).Text() then wrap with fetcher.FormatPrice()Register via init():
func init() {
fetcher.RegisterFetcher(&<market>Fetcher{})
}
Add a blank import in internal/app/kabuka/kabuka.go:
_ "github.com/shionit/kabuka/internal/app/kabuka/fetcher/<market>"
Add integration test cases to kabuka_integration_test.go covering at least one symbol from the new market.
Verify:
go build ./...
go test -tags integration -run TestKabuka_fetch ./internal/app/kabuka/...