chessdotcomgo

package module
v0.0.0-...-035f681 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2021 License: MIT Imports: 6 Imported by: 0

README

Chessdotcom-go

An unofficial, simple, lighweight API wrapper for chess.com written in go

Usage

Complete Documentation can be found at https://pkg.go.dev/github.com/ATTron/chessdotcom-go

    go get -u "github.com/ATTron/chessdotcom-go"
If you just need the JSON string
    import chess "github.com/ATTron/chessdotcom-go"

    . . .

    const username = 'hikaru'

    func main() {
        userStats := chess.GetUserStats(username)
        fmt.Println(userStats)
    }
If you want to use the JSON in a meaningful way in go I highly recommend using gjson
    import (
        chess "github.com/ATTron/chessdotcom-go"
        "github.com/tidwall/gjson"
    )

    . . .

    const username = "hikaru"

    func main() {
        userStats := chess.GetUserStats(username)
        blitz := gjson.Get(userStats, "chess_blitz")
        fmt.Println(blitz.String())
        rapid := gjson.Get(userStats, "chess_rapid.record")
        fmt.Println(rapid.String())
    }

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClub

func GetClub(clubID string) string

GetClub - Returns details about a club

func GetClubMatches

func GetClubMatches(clubID string) string

GetClubMatches - Returns club match details

func GetClubMembers

func GetClubMembers(clubID string) string

GetClubMembers - Returns details a specific club members

func GetCountry

func GetCountry(countryISO int) string

GetCountry - Returns details about specific country

func GetCountryClubs

func GetCountryClubs(countryISO int) string

GetCountryClubs - Returns details about specific country's clubs

func GetCountryPlayers

func GetCountryPlayers(countryISO int) string

GetCountryPlayers - Returns details about specific country's players

func GetDailyPuzzle

func GetDailyPuzzle() string

GetDailyPuzzle - Returns details about the daily puzzle

func GetDailyTeamMatch

func GetDailyTeamMatch(matchID int) string

GetDailyTeamMatch - Returns daily team match details

func GetDailyTeamMatchBoard

func GetDailyTeamMatchBoard(matchID int, board int) string

GetDailyTeamMatchBoard - Returns daily team match board details

func GetLeaderboard

func GetLeaderboard() string

GetLeaderboard - Returns details about the chess.com leaderboard

func GetLiveTeamMatch

func GetLiveTeamMatch(matchID int) string

GetLiveTeamMatch - Returns live team match details

func GetLiveTeamMatchBoard

func GetLiveTeamMatchBoard(matchID int, board int) string

GetLiveTeamMatchBoard - Returns live team match board details

func GetPlayerGames

func GetPlayerGames(username string) string

GetPlayerGames - Return current user games

func GetPlayerGamesArchive

func GetPlayerGamesArchive(username string, year int, month int) string

GetPlayerArchive - Return games the player has played in a specific month

func GetPlayerGamesArchivePGN

func GetPlayerGamesArchivePGN(username string, year int, month int) string

GetPlayerGamesArchivePGN (Currently broken) - Return games the player has played in a specific month

func GetPlayerGamesMonthly

func GetPlayerGamesMonthly(username string) string

GetPlayerGamesMonthly - Return games the player has played in the past month

func GetPlayerGamesToMove

func GetPlayerGamesToMove(username string) string

GetPlayerGamesToMove - Return player who has to move

func GetPlayerMatches

func GetPlayerMatches(username string) string

GetPlayerMatches - Returns list of team matches the player is currently registered in

func GetPlayerStatus

func GetPlayerStatus(username string) string

GetPlayerStatus (Currently Broken) - Returns T/F of players online status

func GetPlayerTournaments

func GetPlayerTournaments(username string) string

GetPlayerTournaments

func GetRandomPuzzle

func GetRandomPuzzle() string

GetRandomPuzzle - Returns details about a random puzzle

func GetStreamers

func GetStreamers() string

GetStreamers - Returns details about chess.com streamers

func GetTitledPlayers

func GetTitledPlayers(title string) string

GetTitledPlayers - Returns an array of all titled players of specific type (i.e. GM, WGM, IM, etc)

func GetTournament

func GetTournament(tournamentID string) string

GetTournament - Returns tournament details

func GetTournamentRound

func GetTournamentRound(tournamentID string, round int) string

GetTournamentRound - Returns tournament round details

func GetTournamentRoundGroup

func GetTournamentRoundGroup(tournamentID string, round int, group int) string

GetTournamentRoundGroup - Returns tournament round group details

func GetUser

func GetUser(username string) string

GetUser - Returns basic info about a specific user

func GetUserStats

func GetUserStats(username string) string

GetUserStats - Returns statistics about a specific user

Types

type UserInfo

type UserInfo struct {
	BasicInfo   string `json:"basic_info"`
	Stats       string `json:"stats"`
	OnlineStats string `json:"online"`
}

func GetAllData

func GetAllData(username string) UserInfo

GetAllData - Return all user info in one object

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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