coolstuffinc

package
v0.0.0-...-86a7292 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: MIT Imports: 19 Imported by: 2

Documentation

Index

Constants

View Source
const (
	GameMagic             = "mtg"
	GameLorcana           = "lorcana"
	GameYugioh            = "yugioh"
	GameDragonBallSuper   = "dbs"
	GameOnePiece          = "optcg"
	GameStarWarsUnlimited = "swu"
	GamePokemon           = "pokemon"
)

Variables

This section is empty.

Functions

func LoadBuylistEditions

func LoadBuylistEditions(game string) (map[string]string, error)

Load the list of editions to id used to build links

func Preprocess

func Preprocess(card CSICard) (*mtgmatcher.InputCard, error)

func PreprocessBuylist

func PreprocessBuylist(card CSIPriceEntry) (*mtgmatcher.InputCard, error)

Types

type CSICard

type CSICard struct {
	Id             int     `json:"id,string"`
	URL            string  `json:"url"`
	Name           string  `json:"name"`
	ScryfallId     string  `json:"scryfallid"`
	Variation      string  `json:"variation"`
	Edition        string  `json:"edition"`
	Language       string  `json:"language"`
	IsFoil         bool    `json:"is_foil,string"`
	PriceRetail    float64 `json:"price_retail,string"`
	QuantityRetail int     `json:"qty_retail,string"`
	PriceBuy       float64 `json:"price_buy,string"`
	QuantityBuy    int     `json:"qty_buying,string"`
}

type CSIClient

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

func NewCSIClient

func NewCSIClient(key string) *CSIClient

func (*CSIClient) GetPriceList

func (csi *CSIClient) GetPriceList() ([]CSICard, error)

type CSIPriceEntry

type CSIPriceEntry struct {
	PID string `json:"PID"`
	// Ppqid         string `json:"PPQID"`
	Name string `json:"Name"`
	// Rarity        string `json:"Rarity"`
	ItemSet string `json:"ItemSet"`
	// Image   string `json:"Image"`
	Notes string `json:"Notes"`
	// SName         string `json:"sName"`
	// SAbbreviation string `json:"sAbbreviation"`
	Price string `json:"Price"`
	// TName         string `json:"tName"`
	// Color         string `json:"Color"`
	Number string `json:"Number"`
	// Code   string `json:"Code"`
	// BuyListNotes  string `json:"BuyListNotes"`
	// FullImage     struct {} `json:"FullImage"`
	RarityName  string `json:"RarityName"`
	IsFoil      int    `json:"isFoil"`
	CreditPrice string `json:"CreditPrice"`
}

func GetBuylist

func GetBuylist(game string) ([]CSIPriceEntry, error)

type Coolstuffinc

type Coolstuffinc struct {
	LogCallback mtgban.LogCallbackFunc
	Partner     string

	// If set to true scrape will skip all entries without a nonfoil NM price
	// but will be almost twice as fast
	FastMode bool

	MaxConcurrency int
	// contains filtered or unexported fields
}

func NewScraper

func NewScraper(game string) *Coolstuffinc

func (*Coolstuffinc) Buylist

func (csi *Coolstuffinc) Buylist() (mtgban.BuylistRecord, error)

func (*Coolstuffinc) Info

func (csi *Coolstuffinc) Info() (info mtgban.ScraperInfo)

func (*Coolstuffinc) Inventory

func (csi *Coolstuffinc) Inventory() (mtgban.InventoryRecord, error)

type CoolstuffincOfficial

type CoolstuffincOfficial struct {
	LogCallback mtgban.LogCallbackFunc
	Partner     string
	// contains filtered or unexported fields
}

func NewScraperOfficial

func NewScraperOfficial(key string) *CoolstuffincOfficial

func (*CoolstuffincOfficial) Buylist

func (csi *CoolstuffincOfficial) Buylist() (mtgban.BuylistRecord, error)

func (*CoolstuffincOfficial) Info

func (csi *CoolstuffincOfficial) Info() (info mtgban.ScraperInfo)

func (*CoolstuffincOfficial) Inventory

func (csi *CoolstuffincOfficial) Inventory() (mtgban.InventoryRecord, error)

type CoolstuffincSealed

type CoolstuffincSealed struct {
	LogCallback mtgban.LogCallbackFunc
	Partner     string

	MaxConcurrency int
	// contains filtered or unexported fields
}

func NewScraperSealed

func NewScraperSealed() *CoolstuffincSealed

func (*CoolstuffincSealed) Buylist

func (csi *CoolstuffincSealed) Buylist() (mtgban.BuylistRecord, error)

func (*CoolstuffincSealed) Info

func (csi *CoolstuffincSealed) Info() (info mtgban.ScraperInfo)

func (*CoolstuffincSealed) Inventory

func (csi *CoolstuffincSealed) Inventory() (mtgban.InventoryRecord, error)

type SearchResult

type SearchResult struct {
	PageId string
	Data   []byte
}
func Search(game, itemName string, skipOOS bool) (*SearchResult, error)

Convert the item name to the id and the first page of results

Jump to

Keyboard shortcuts

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