scraper

package module
v0.0.0-...-c2109c6 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2016 License: MIT Imports: 7 Imported by: 4

README

PlayerStatsScraper

Build Status Coverage Status GoDoc

License

Released under the MIT License

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoGamesOwned = errors.New("No Steam game in player's profile.")
View Source
var PersonaStatesStr = [...]string{
	"Offline",
	"Online",
	"Busy",
	"Away",
	"Snooze",
	"Looking to Trade",
	"Looking to Play",
}

Functions

func GetSteamGamesOwned

func GetSteamGamesOwned(steamid string) (*map[string]string, error)

func GetTF2Hours

func GetTF2Hours(steamid string) (int, error)

func GetTF2HoursFromGamesOwned

func GetTF2HoursFromGamesOwned(res *map[string]string) int

func GetTF2Stats

func GetTF2Stats(steamid string) (*map[string]string, error)

func SetSteamApiKey

func SetSteamApiKey(key string)

Types

type PersonaState

type PersonaState int
const (
	PersonaStateOffline PersonaState = 0
	PersonaStateOnline  PersonaState = 1
	PersonaStateBusy    PersonaState = 2
	PersonaStateAway    PersonaState = 3
	PersonaStateSnooze  PersonaState = 4
	PersonaStateLTTrade PersonaState = 5
	PersonaStateLTPlay  PersonaState = 6
)

func (*PersonaState) String

func (ps *PersonaState) String() string

type PlayerInfo

type PlayerInfo struct {
	// name
	Name        string
	Personaname string
	Realname    string

	// profile
	Profileurl        string
	Personastate      PersonaState
	Profilestate      int
	Commentpermission string

	// steam
	Steamid                  string
	Communityvisibilitystate int
	Visibility               string

	// time creaTed
	Timecreated int

	// location
	Loccountrycode string
	Locstatecode   string
	Loccityid      int

	// logoff
	Lastlogoff int

	// avatar
	Avatar       string
	Avatarfull   string
	Avatarmedium string
}

func GetPlayerInfo

func GetPlayerInfo(steamid string) (*PlayerInfo, error)

func (*PlayerInfo) GetLogoffTime

func (p *PlayerInfo) GetLogoffTime() time.Time

get player "lastlogoff" as Time

func (*PlayerInfo) GetTimeCreated

func (p *PlayerInfo) GetTimeCreated() time.Time

get player "timecreated" as Time

func (*PlayerInfo) Parse

func (p *PlayerInfo) Parse(elem map[string]interface{}) error

parse player json

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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