Added Fetcher
This commit is contained in:
parent
b823cffe69
commit
40f1687972
10 changed files with 36 additions and 19 deletions
|
|
@ -12,7 +12,7 @@ import (
|
|||
|
||||
const ScryfallUrl = "https://api.scryfall.com"
|
||||
|
||||
func GetNameByCardId(set string, number string) string {
|
||||
func (f *Fetcher) GetNameByCardId(set string, number string) string {
|
||||
/*
|
||||
Note: number is string because some cards contain letters in their numbers.
|
||||
*/
|
||||
|
|
@ -20,7 +20,7 @@ func GetNameByCardId(set string, number string) string {
|
|||
return GetCardByUrl(path)
|
||||
}
|
||||
|
||||
func GetOriginalName(name string, dict io.Reader) string {
|
||||
func (f *Fetcher) GetOriginalName(name string, dict io.Reader) string {
|
||||
path := ScryfallUrl + "/cards/named?fuzzy=" + ApplyFilters(name)
|
||||
result := GetCardByUrl(path)
|
||||
if result == "" && dict != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue