Documentation
¶
Overview ¶
Package fetch retrieves desired information from the [en.]ws-tcg.com websites.
Index ¶
Constants ¶
View Source
const CardModelVersion = "1"
CardModelVersion : Card format version
View Source
const ProductsUrl = "https://ws-tcg.com/products/page/"
Variables ¶
This section is empty.
Functions ¶
func CardsStream ¶
func ExpansionList ¶ added in v0.1.1
ExpansionList returns a map of expansion numbers to their titles for the specified language in the Config.
func IsbaseRarity ¶
IsbaseRarity check if a card is a C / U / R / RR
Types ¶
type Card ¶
type Card struct {
// CardNumber is the full card number/code used to identify each card.
// It typically consists of the SetID, Side, Release, ReleasePackID, and ID,
// though the format is different in some situations.
CardNumber string `json:"cardNumber"`
// SetID is the alphanumeric string found at the beginning of card numbers,
// before the "/"".
SetID string `json:"setId"`
// SetName is the official name of the set.
SetName string `json:"setName"`
ExpansionName string `json:"expansionName"`
// Side is either "W" for Weiss, or "S" for Schwarz.
Side string `json:"side"`
// Release typically consists of the card's side, followed by a number
// (the release pack ID) indicating which consecutive release for the relative
// side the release is.
// For example, "W64" would mean the 64th set of the Weiss side.
// There are certain situations that don't follow the aforementioned format,
// such as with promo cards (eg. BSF2024) or special sets (eg. EN-W03).
Release string `json:"release"`
// ReleasePackID indicates which consecutive release for the relative
// side the release is.
// For example, "W64" would mean the 64th set of the Weiss side.
// For cards with non-standard release codes, a best-effort/most sensible
// ID is chosen (eg. 2021 from BSL2021). This may be empty if there's
// no sensible ID to choose (eg. from TCPR-P01).
ReleasePackID string `json:"releasePackId"`
// ID of the card within the set+release. This is usually the last part
// of the card number (after the -).
ID string `json:"id"`
// Language the card is printed in.
Language string `json:"language"`
// Type can be either "CH" for character, "EV" for event, or "CX" for climax.
Type string `json:"type"`
// Name of the card.
Name string `json:"name"`
// Color of the card. Should be either "BLUE", "GREEN", "RED", or "YELLOW".
// ...Except for the two purple cards (むらさきパプリス(PY/S38-125) and むらさきぷよ(PY/S38-120)).
Color string `json:"color"`
// Cost to play the card
Cost string `json:"cost"`
// Level required in order to play the card.
Level string `json:"level"`
// Power indicates the card's battle strength. Only valid for Character cards.
Power string `json:"power"`
// Soul is an integer indicating how many soul points the card has. Only valid for Character cards.
Soul string `json:"soul"`
// Text describing the card's abilities.
Text []string `json:"text"`
// Traits indicating the attributes the card has. These are often referenced in card text.
Traits []string `json:"traits"`
// Triggers that the card has and are activated during trigger checks.
Triggers []string `json:"triggers"`
FlavorText string `json:"flavorText"`
ImageURL string `json:"imageURL"`
Image image.Image `json:"-"`
Rarity string `json:"rarity"`
Version string `json:"version"`
}
Card info to export
type Config ¶
type Config struct {
// The website's internal code for each expansion. The value is language-specific.
// For example,
// 159 is "BanG Dream! Girls Band Party Premium Booster" in EN
// 159 is "Monogatari Series: Second Season"
ExpansionNumber int
GetAllRarities bool
GetImages bool
GetRecent bool
Language SiteLanguage
PageStart int
Reverse bool
SetCode []string
// The website's internal code for each set. The value is language-specific.
// For example
// 159 is "Tokyo Revengers" in EN
// 159 isn't supported in JP
TitleNumber int
}
type ProductInfo ¶
type ProductInfo struct {
ReleaseDate string
Title string
LicenceCode string
Image string
SetCode string
}
ProductInfo represents the extracted information from the HTML
func Products ¶
func Products(page string) []ProductInfo
type SiteLanguage ¶
var ( English SiteLanguage = SiteLanguage(language.English) Japanese SiteLanguage = SiteLanguage(language.Japanese) )
func (SiteLanguage) String ¶ added in v0.1.2
func (s SiteLanguage) String() string
Click to show internal directories.
Click to hide internal directories.