goverbuff

package module
v0.0.0-...-7d5592e Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2020 License: MIT Imports: 9 Imported by: 0

README

goverbuff

A package for scraping player information from Overbuff.

Why?

Unofficial APIs that scrape stats from the Blizzard website are nice, but they're only useful when the person's profile isn't private. Overbuff still has stats for private profiles from before the change was made, giving at the very least an estimate of somebody's skill level (even if it's inaccurate).

Documentation

Index

Constants

View Source
const Timeout = 5

Timeout is the timeout for the client returned by DefaultClient().

Variables

This section is empty.

Functions

func DefaultClient

func DefaultClient() *http.Client

DefaultClient returns a client with a reasonable timeout.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound checks if an error produced by GetPlayer is a 404 error

Types

type Player

type Player struct {
	BTag  string
	SR    int
	Roles map[string]int
}

Player stores player stats scraped from Overbuff.

func GetPlayer

func GetPlayer(c *http.Client, btag string) (Player, error)

GetPlayer returns player stats scraped from Overbuff.

Using http.DefaultClient isn't recommended because it has no timeout set; use goverbuff.DefaultClient() or create a client with a sane timeout.

func (*Player) Main

func (p *Player) Main() string

Main returns a player's main role. A player's main role here is the role they have the most wins on.

Jump to

Keyboard shortcuts

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