plugins

package
v0.0.0-...-5503436 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: GPL-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Magic. This plugin will download magic cards from scryfall. As a fallback it will use the gatherer website! (http://gatherer.wizards.com/)

This package contains the API and glue which let's the plugins work.

Magic. This plugin will download magic cards from http://wowcards.info

Card images can be found on a line like this:
 <img id="cardimage" width="312" height="440" class="img-rounded lazy swapImage {src: '/scans/timewalkers/en/3-back.jpg'}"  style="border: 1px solid black;" alt="Barador, Wildhammer Timewalker" title="Barador, Wildhammer Timewalker" data-original="/scans/timewalkers/en/3_Barador-Wildhammer-Timewalker.jpg" src="/scans/no-scan-upperdeck.jpg" />
 data-original is what we are after.

Index

Constants

View Source
const Cardfight = "cardfight"
View Source
const Custom = "custom"
View Source
const Magic = "magic"
View Source
const (
	None = "none"
)
View Source
const Pokemon = "pokemon"
View Source
const Text = "text"
View Source
const Wow = "wow"
View Source
const Yugioh = "yugioh"

Variables

View Source
var DeckerCachePath string

Functions

func Autodetect

func Autodetect(name, input string) []string

func GetBack

func GetBack(game string) string

func GetImageName

func GetImageName(game, name string) string

func Handle

func Handle(err error)

Error handler, all bad errors will be sent here.

func Identify

func Identify(line string) string

func Plugins

func Plugins() map[string]*Plugin

func RegisterBack

func RegisterBack(game string, link string)

func RegisterCacheImageName

func RegisterCacheImageName(game string, function func(string) string)

func RegisterHeaders

func RegisterHeaders(game string, headers []string)

func RegisterPlugin

func RegisterPlugin(game string, function func(string, string, bool) string)

func Run

func Run(game, name, input string) string

func SetImageName

func SetImageName(game, name, imagename string)

Types

type MagicCard

type MagicCard struct {
	Images struct {
		Large string `json:"large"`
	} `json:"image_uris"`
	CardFaces []struct {
		ImageUris struct {
			Large string `json:"large"`
		} `json:"image_uris"`
	} `json:"card_faces"`
}

type Plugin

type Plugin struct {
	Game          string
	Function      func(string, string, bool) string
	ImageNames    map[string]string
	ImageFunction func(string) string
	Mutex         *sync.Mutex
}

A plugin contains it's card getting function and it's ID or Game and A map of ImageNames if they change.

Jump to

Keyboard shortcuts

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