Mort has a .crypto command (pkg/crypto/crypto.go) that displays cryptocurrency prices with charts. Currently it screenshots a self-hosted chart endpoint using go-extractor. A CoinGecko site extractor would provide structured price data that could complement or replace the screenshot approach.
CoinGecko is the most widely used free crypto data aggregator and doesn't require an API key for basic page scraping.
Structured crypto price data for mort's .crypto command
No API key required (browser-based scraping)
Could add chart screenshot support too
Useful for any go-extractor consumer needing crypto prices
## Description
Mort has a `.crypto` command (`pkg/crypto/crypto.go`) that displays cryptocurrency prices with charts. Currently it screenshots a self-hosted chart endpoint using go-extractor. A CoinGecko site extractor would provide structured price data that could complement or replace the screenshot approach.
CoinGecko is the most widely used free crypto data aggregator and doesn't require an API key for basic page scraping.
## Proposed API
```go
package coingecko
type CoinPrice struct {
Name string
Symbol string
Price float64
Change24h float64 // percentage
Change7d float64
MarketCap float64
Volume24h float64
High24h float64
Low24h float64
}
type Config struct{}
var DefaultConfig = Config{}
func (c Config) GetPrice(ctx context.Context, b extractor.Browser, coin string) (*CoinPrice, error)
```
## URL Pattern
`https://www.coingecko.com/en/coins/{coin-id}` — e.g., `https://www.coingecko.com/en/coins/bitcoin`
## Benefits
- Structured crypto price data for mort's `.crypto` command
- No API key required (browser-based scraping)
- Could add chart screenshot support too
- Useful for any go-extractor consumer needing crypto prices
Implemented in PR #46. Added sites/coingecko package with GetPrice() method returning CoinPrice (name, symbol, price, 24h/7d change, market cap, volume, 24h high/low). Includes parseLargeNumber() for T/B/M suffix handling and full mock-based test coverage.
Implemented in PR #46. Added `sites/coingecko` package with `GetPrice()` method returning `CoinPrice` (name, symbol, price, 24h/7d change, market cap, volume, 24h high/low). Includes `parseLargeNumber()` for T/B/M suffix handling and full mock-based test coverage.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Description
Mort has a
.cryptocommand (pkg/crypto/crypto.go) that displays cryptocurrency prices with charts. Currently it screenshots a self-hosted chart endpoint using go-extractor. A CoinGecko site extractor would provide structured price data that could complement or replace the screenshot approach.CoinGecko is the most widely used free crypto data aggregator and doesn't require an API key for basic page scraping.
Proposed API
URL Pattern
https://www.coingecko.com/en/coins/{coin-id}— e.g.,https://www.coingecko.com/en/coins/bitcoinBenefits
.cryptocommandImplemented in PR #46. Added
sites/coingeckopackage withGetPrice()method returningCoinPrice(name, symbol, price, 24h/7d change, market cap, volume, 24h high/low). IncludesparseLargeNumber()for T/B/M suffix handling and full mock-based test coverage.