cardmarket

package
v0.0.0-...-faf8d4c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2024 License: MIT Imports: 22 Imported by: 2

Documentation

Index

Constants

View Source
const (
	GameIdMagic = iota + 1
	GameIdWorldOfWarcraft
	GameIdYugioh

	GameIdTheSpoils
	GameIdPokemon
	GameIdForceOfWill
	GameIdCardfightVanguard
	GameIdFinalFantasy
	GameIdWeissSchwarz
	GameIdDragoborne
	GameIdMyLittlePony
	GameIdDragonBallSuper

	GameIdStarWarsDestiny
	GameIdFleshAndBlood
	GameIdDigimon
	GameIdOnePiece
	GameIdLorcana
	GameIdBattleSpiritsSaga
	GameIdStarWarsUnlimited
)

Variables

This section is empty.

Functions

func Preprocess

func Preprocess(cardName, number, edition string) (*mtgmatcher.InputCard, error)

Types

type CardMarketIndex

type CardMarketIndex struct {
	LogCallback mtgban.LogCallbackFunc

	Affiliate      string
	MaxConcurrency int
	// contains filtered or unexported fields
}

func NewScraperIndex

func NewScraperIndex(gameId int, appToken, appSecret string) (*CardMarketIndex, error)

func (*CardMarketIndex) Info

func (mkm *CardMarketIndex) Info() (info mtgban.ScraperInfo)

func (*CardMarketIndex) InfoForScraper

func (mkm *CardMarketIndex) InfoForScraper(name string) mtgban.ScraperInfo

func (*CardMarketIndex) Inventory

func (mkm *CardMarketIndex) Inventory() (mtgban.InventoryRecord, error)

func (*CardMarketIndex) MarketNames

func (mkm *CardMarketIndex) MarketNames() []string

type CardMarketSealed

type CardMarketSealed struct {
	LogCallback    mtgban.LogCallbackFunc
	MaxConcurrency int
	Affiliate      string
	// contains filtered or unexported fields
}

func NewScraperSealed

func NewScraperSealed(appToken, appSecret string) (*CardMarketSealed, error)

func (*CardMarketSealed) Info

func (mkm *CardMarketSealed) Info() (info mtgban.ScraperInfo)

func (*CardMarketSealed) Inventory

func (mkm *CardMarketSealed) Inventory() (mtgban.InventoryRecord, error)

type MKMArticle

type MKMArticle struct {
	IdArticle int `json:"idArticle"`
	IdProduct int `json:"idProduct"`
	Language  struct {
		IdLanguage   int    `json:"idLanguage"`
		LanguageName string `json:"languageName"`
	} `json:"language"`
	Comments       string  `json:"comments"`
	Price          float64 `json:"price"`
	IdCurrency     int     `json:"idCurrency"`
	CurrencyCode   string  `json:"currencyCode"`
	Count          int     `json:"count"`
	InShoppingCart bool    `json:"inShoppingCart"`
	Condition      string  `json:"condition"`
	Product        struct {
		Name      string `json:"enName"`
		Expansion string `json:"expansion"`
		Number    string `json:"nr"`
	} `json:"product"`
	Seller struct {
		IdUser   int    `json:"idUser"`
		Username string `json:"username"`
		Address  struct {
			Country string `json:"country"`
		} `json:"address"`
	}
	IsFoil    bool `json:"isFoil"`
	IsSigned  bool `json:"isSigned"`
	IsPlayset bool `json:"isPlayset"`
	IsAltered bool `json:"isAltered"`
}

type MKMClient

type MKMClient struct {
	// contains filtered or unexported fields
}

func NewMKMClient

func NewMKMClient(appToken, appSecret string) *MKMClient

func (*MKMClient) Expansions

func (mkm *MKMClient) Expansions(gameId int) ([]MKMExpansion, error)

func (*MKMClient) MKMArticles

func (mkm *MKMClient) MKMArticles(id int, options map[string]string, page, maxResults int) ([]MKMArticle, error)

Note that page should start from 0

func (*MKMClient) MKMProduct

func (mkm *MKMClient) MKMProduct(id int) (*MKMProduct, error)

func (*MKMClient) MKMProductsInExpansion

func (mkm *MKMClient) MKMProductsInExpansion(id int) ([]MKMProduct, error)

func (*MKMClient) MKMSimpleArticles

func (mkm *MKMClient) MKMSimpleArticles(id int, onlyEnglish bool, page, maxResults int) ([]MKMArticle, error)

func (*MKMClient) RequestNo

func (mkm *MKMClient) RequestNo() int

type MKMExpansion

type MKMExpansion struct {
	IdExpansion int    `json:"idExpansion"`
	Name        string `json:"enName"`
	SetCode     string `json:"abbreviation"`
	Icon        int    `json:"icon"`
	ReleaseDate string `json:"releaseDate"`
	IsReleased  bool   `json:"isReleased"`
}

type MKMProduct

type MKMProduct struct {
	IdProduct     int    `json:"idProduct"`
	IdMetaproduct int    `json:"idMetaproduct"`
	Name          string `json:"enName"`
	Website       string `json:"website"`
	Number        string `json:"number"`
	ExpansionName string `json:"expansionName"`
	Expansion     struct {
		IdExpansion int    `json:"idExpansion"`
		Name        string `json:"enName"`
	} `json:"expansion"`
	PriceGuide    map[string]float64 `json:"priceGuide"`
	CountArticles int                `json:"countArticles"`
	CountFoils    int                `json:"countFoils"`
}

type PreprocessError

type PreprocessError struct {
	Extra string
	Err   error
}

func (*PreprocessError) Error

func (pe *PreprocessError) Error() string

type PriceGuide

type PriceGuide struct {
	IdProduct        int     `json:"idProduct"`
	AvgSellPrice     float64 `json:"avg"`
	LowPrice         float64 `json:"low"`
	TrendPrice       float64 `json:"trend"`
	FoilAvgSellPrice float64 `json:"avg-foil"`
	FoilLowPrice     float64 `json:"low-foil"`
	FoilTrendPrice   float64 `json:"trend-foil"`
	AvgDay1          float64 `json:"avg1"`
	AvgDay7          float64 `json:"avg7"`
	AvgDay30         float64 `json:"avg30"`
	FoilAvgDay1      float64 `json:"avg1-foil"`
	FoilAvgDay7      float64 `json:"avg7-foil"`
	FoilAvgDay30     float64 `json:"avg30-foil"`
}

func GetPriceGuide

func GetPriceGuide(gameId int) ([]PriceGuide, error)

type ProductList

type ProductList struct {
	IdProduct    int    `json:"idProduct"`
	Name         string `json:"name"`
	CategoryID   int    `json:"idCategory"`
	CategoryName string `json:"categoryName"`
	ExpansionID  int    `json:"idExpansion"`
	MetacardID   int    `json:"idMetacard"`
	DateAdded    string `json:"dateAdded"`
}

func GetProductListSealed

func GetProductListSealed(gameId int) ([]ProductList, error)

func GetProductListSingles

func GetProductListSingles(gameId int) ([]ProductList, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL