scraper

package
v0.0.0-...-52bad84 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2016 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearName

func ClearName(name string) string

Removes everything between (), [], {} FIXME Is it doable in one regexp ?

func CompareFilename

func CompareFilename(first string, second string) float32

Code re-used from https://github.com/remeh/go-subtitles to compute the percentage of matching words into the given strings.

func Decode

func Decode(filename string) (Gamesinfo, error)

func Download

func Download(url string, name string, suffix string, outputDirectory string, resizeWidth uint) (string, error)

Download downlads the given url and saves it to name+prefix file of the current dir. If resizeWidth > 0, some resizing will be done before saving the file.

func Encode

func Encode(gameinfo *Gamesinfo) ([]byte, error)

func FillDefaults

func FillDefaults(inputDirectory, filename string, gameinfo *model.Gameinfo)

func RemoveExtension

func RemoveExtension(filename string) string

func RemoveSpecialChars

func RemoveSpecialChars(s string) string

Remove the special chars from the given string and returns the result.

func ResizeAndWrite

func ResizeAndWrite(filename string, data []byte, writer io.Writer, maxWidth uint) error

ResizeImage uses the given data as an image and resize it with the max width given (computing the height). The filename is needed to know the filetype of the image.

Types

This section is empty.

Jump to

Keyboard shortcuts

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