starcitygames

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: 16 Imported by: 2

Documentation

Index

Constants

View Source
const (
	GameMagic         = 1
	GameFleshAndBlood = 2
	GameLorcana       = 3
)

Variables

This section is empty.

Functions

func ProcessSKU

func ProcessSKU(cardName, SKU string) (*mtgmatcher.InputCard, error)

SKU documented as * for singles: SGL-[Brand]-[Set]-[Collector Number]-[Language][Foiling][Condition] * for world champtionship: SGL-[Brand]-WCPH-[Year][Player Initials][Set][Collector Number][Sideboard]-[Language][Foiling][Condition] * for promotional cards: SGL-[Brand]-PRM-[Promo][Set][Collector Number]-[Language][Foiling][Condition]

examples * SGL-MTG-PRM-SECRET_SLD_1095-ENN1 * SGL-MTG-PRM-PP_MKM_187-ENN * SGL-MTG-PWSB-PCA_115-ENN1

func SCGProductURL

func SCGProductURL(URLDetail, variantSKU []string, affiliate string) string

Types

type SCGCard

type SCGCard struct {
	Name            string           `json:"name"`
	ID              int              `json:"id"`
	Subtitle        string           `json:"subtitle"`
	ProductType     string           `json:"product_type"`
	Finish          string           `json:"finish"`
	Language        string           `json:"language"`
	Rarity          string           `json:"rarity"`
	IsBuying        int              `json:"is_buying"`
	Hotlist         int              `json:"hotlist"`
	BorderColor     string           `json:"border_color"`
	CollectorNumber string           `json:"collector_number"`
	SetID           int              `json:"set_id"`
	SetName         string           `json:"set_name"`
	SetReleaseDate  int              `json:"set_release_date"`
	SetSymbol       string           `json:"set_symbol"`
	Variants        []SCGCardVariant `json:"variants"`
}

type SCGCardVariant

type SCGCardVariant struct {
	ID           int     `json:"id"`
	Name         string  `json:"name"`
	Subtitle     string  `json:"subtitle"`
	Sku          string  `json:"sku"`
	IsBuying     int     `json:"is_buying"`
	Hotlist      float64 `json:"hotlist"`
	VariantName  string  `json:"variant_name"`
	VariantValue string  `json:"variant_value"`
	BuyPrice     float64 `json:"buy_price"`
	TradePrice   float64 `json:"trade_price"`
}

type SCGClient

type SCGClient struct {
	SealedMode bool
	// contains filtered or unexported fields
}

func NewSCGClient

func NewSCGClient(guid, bearer string) *SCGClient

func (*SCGClient) GetPage

func (scg *SCGClient) GetPage(game, page int) ([]scgRetailResult, error)

func (*SCGClient) NumberOfPages

func (scg *SCGClient) NumberOfPages(game int) (int, error)

func (*SCGClient) SearchAll

func (scg *SCGClient) SearchAll(game, offset, limit int, rarity string) (*SCGSearchResponse, error)

type SCGSearchRequest

type SCGSearchRequest struct {
	Q                string   `json:"q"`
	Filter           string   `json:"filter"`
	MatchingStrategy string   `json:"matchingStrategy"`
	Limit            int      `json:"limit"`
	Offset           int      `json:"offset"`
	Sort             []string `json:"sort"`
}

type SCGSearchResponse

type SCGSearchResponse struct {
	Message            string    `json:"message,omitempty"`
	Code               string    `json:"code,omitempty"`
	Type               string    `json:"type,omitempty"`
	Link               string    `json:"link,omitempty"`
	Hits               []SCGCard `json:"hits"`
	Query              string    `json:"query"`
	ProcessingTimeMs   int       `json:"processingTimeMs"`
	Limit              int       `json:"limit"`
	Offset             int       `json:"offset"`
	EstimatedTotalHits int       `json:"estimatedTotalHits"`
}

type Settings

type Settings struct {
	CardRarities []struct {
		ID               int       `json:"id"`
		Name             string    `json:"name"`
		GameID           int       `json:"game_id"`
		Abbr             string    `json:"abbr"`
		ExternalRarityID int       `json:"external_rarity_id"`
		SortOrder        int       `json:"sort_order"`
		CreatedAt        time.Time `json:"created_at"`
		UpdatedAt        time.Time `json:"updated_at"`
	} `json:"cardRarities"`
}

func SearchSettings

func SearchSettings() (*Settings, error)

type Starcitygames

type Starcitygames struct {
	LogCallback mtgban.LogCallbackFunc

	MaxConcurrency int

	Affiliate string
	// contains filtered or unexported fields
}

func NewScraper

func NewScraper(game int, guid, bearer string) *Starcitygames

func (*Starcitygames) Buylist

func (scg *Starcitygames) Buylist() (mtgban.BuylistRecord, error)

func (*Starcitygames) Info

func (scg *Starcitygames) Info() (info mtgban.ScraperInfo)

func (*Starcitygames) Inventory

func (scg *Starcitygames) Inventory() (mtgban.InventoryRecord, error)

type StarcitygamesSealed

type StarcitygamesSealed struct {
	LogCallback mtgban.LogCallbackFunc

	MaxConcurrency int

	Affiliate string
	// contains filtered or unexported fields
}

func NewScraperSealed

func NewScraperSealed(guid, bearer string) *StarcitygamesSealed

func (*StarcitygamesSealed) Buylist

func (scg *StarcitygamesSealed) Buylist() (mtgban.BuylistRecord, error)

func (*StarcitygamesSealed) Info

func (scg *StarcitygamesSealed) Info() (info mtgban.ScraperInfo)

func (*StarcitygamesSealed) Inventory

func (scg *StarcitygamesSealed) Inventory() (mtgban.InventoryRecord, error)

Jump to

Keyboard shortcuts

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