ow_stats

package module
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2018 License: MIT Imports: 14 Imported by: 0

README

OW-stats

Parse stats from the Overwatch website

Inspired by https://github.com/SunDwarf/OWAPI

Informations

For now, this project aim to closely match the json structure of OWAPI. The goal is to have a lightweight library capable of parsing the Overwatch website, and can act as a drop-in replacements for statistics collection.

The schema might change in the future.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HEROES = map[string]string{
	"reaper":        "0x02E0000000000002",
	"tracer":        "0x02E0000000000003",
	"mercy":         "0x02E0000000000004",
	"hanzo":         "0x02E0000000000005",
	"torbjorn":      "0x02E0000000000006",
	"reinhardt":     "0x02E0000000000007",
	"pharah":        "0x02E0000000000008",
	"winston":       "0x02E0000000000009",
	"widowmaker":    "0x02E000000000000A",
	"bastion":       "0x02E0000000000015",
	"symmetra":      "0x02E0000000000016",
	"zenyatta":      "0x02E0000000000020",
	"genji":         "0x02E0000000000029",
	"roadhog":       "0x02E0000000000040",
	"mccree":        "0x02E0000000000042",
	"junkrat":       "0x02E0000000000065",
	"zarya":         "0x02E0000000000068",
	"soldier76":     "0x02E000000000006E",
	"lucio":         "0x02E0000000000079",
	"dva":           "0x02E000000000007A",
	"mei":           "0x02E00000000000DD",
	"ana":           "0x02E000000000013B",
	"sombra":        "0x02E000000000012E",
	"orisa":         "0x02E000000000013E",
	"doomfist":      "0x02E000000000012F",
	"moira":         "0x02E00000000001A2",
	"brigitte":      "0x02E0000000000195",
	"wrecking_ball": "0x02E00000000001CA",
}
View Source
var Request = NewHttpClient()

Functions

func Pluralizer

func Pluralizer(text string) string

func SanitizeAndPluralizeKey

func SanitizeAndPluralizeKey(text string) string

func SanitizeKey

func SanitizeKey(text string) string

func SanitizeValue

func SanitizeValue(text string) float32

Types

type ApiPlatform added in v1.4.0

type ApiPlatform struct {
	Platform    string `json:"platform"`
	Id          int    `json:"id"`
	Name        string `json:"name"`
	UrlName     string `json:"urlName"`
	PlayerLevel int    `json:"playerLevel"`
	Portrait    string `json:"portrait"`
	IsPublic    bool   `json:"isPublic"`
}

type HeroAverageStats

type HeroAverageStats map[string]float32

type HeroGamemodeStats

type HeroGamemodeStats struct {
	Average        *HeroAverageStats        `json:"average_stats,omitempty"`
	RollingAverage *HeroRollingAverageStats `json:"rolling_average_stats,omitempty"`
	Specific       *HeroSpecificStats       `json:"hero_stats,omitempty"`
	General        *HeroGeneralStats        `json:"general_stats,omitempty"`
}

type HeroGeneralStats

type HeroGeneralStats map[string]float32

type HeroPlaytimeStats

type HeroPlaytimeStats map[string]float32

type HeroRollingAverageStats

type HeroRollingAverageStats map[string]float32

type HeroSpecificStats

type HeroSpecificStats map[string]float32

type HeroesGamemodeStats

type HeroesGamemodeStats map[string]*HeroGamemodeStats

Heroes

type HeroesPlaytimeStats

type HeroesPlaytimeStats struct {
	Competitive *HeroPlaytimeStats `json:"competitive,omitempty"`
	Quickplay   *HeroPlaytimeStats `json:"quickplay,omitempty"`
}

type HeroesStats

type HeroesStats struct {
	Playtime *HeroesPlaytimeStats `json:"playtime,omitempty"`
	Stats    *HeroesStatsData     `json:"stats,omitempty"`
}

type HeroesStatsData

type HeroesStatsData struct {
	Competitive *HeroesGamemodeStats `json:"competitive,omitempty"`
	Quickplay   *HeroesGamemodeStats `json:"quickplay,omitempty"`
}

type HttpClient added in v1.2.0

type HttpClient struct {
	// contains filtered or unexported fields
}

func NewHttpClient added in v1.2.0

func NewHttpClient() *HttpClient

func (*HttpClient) Get added in v1.2.0

func (c *HttpClient) Get(url string) (*http.Response, error)

type PlayerAverageStats

type PlayerAverageStats map[string]float32

type PlayerGameStats

type PlayerGameStats map[string]float32

Player

type PlayerGamemodeStats

type PlayerGamemodeStats struct {
	Competitive    bool                       `json:"competitive,omitempty"`
	Average        *PlayerAverageStats        `json:"average_stats,omitempty"`
	RollingAverage *PlayerRollingAverageStats `json:"rolling_average_stats,omitempty"`
	Overall        *PlayerOverallStats        `json:"overall_stats,omitempty"`
	Game           *PlayerGameStats           `json:"game_stats,omitempty"`
}

type PlayerOverallStats

type PlayerOverallStats struct {
	Level     int      `json:"level"`
	Comprank  int      `json:"comprank,omitempty"`
	Games     int      `json:"games"`
	WinRate   *float32 `json:"win_rate"`
	Losses    int      `json:"losses"`
	Wins      int      `json:"wins"`
	Ties      int      `json:"ties"`
	Prestige  int      `json:"prestige"`
	FullLevel int      `json:"full_level"`
}

type PlayerRollingAverageStats

type PlayerRollingAverageStats map[string]float32

type PlayerStats

type PlayerStats struct {
	Competitive *PlayerGamemodeStats `json:"competitive,omitempty"`
	Quickplay   *PlayerGamemodeStats `json:"quickplay,omitempty"`
}

type Profile

type Profile struct {
	Stats       *PlayerStats `json:"stats,omitempty"`
	Heroes      *HeroesStats `json:"heroes,omitempty"`
	UserProfile *ApiPlatform `json:"user_profile"`
}

type ProfileParser

type ProfileParser struct {
	// contains filtered or unexported fields
}

func NewProfileParser

func NewProfileParser(region string, battleTag string) *ProfileParser

func (*ProfileParser) Parse

func (pp *ProfileParser) Parse() (*Profile, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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