Skip to content

Latest commit

 

History

History
57 lines (38 loc) · 1.37 KB

README.md

File metadata and controls

57 lines (38 loc) · 1.37 KB

Go Go Reference

go-habbo

Library to deal with unofficial Habbo API.

Installation

go get github.com/go-habbo/habbo

Usage

Create a parser and a Habbo API client. Then you can fetch Habbos by name or by HHID.

parser := client.NewParser(http.DefaultClient)
api := client.NewHabboAPI(parser)

habbo, err := api.GetHabboByName(ctx, "com", "myHabboName")
if err != nil {
    // handle error
}

When you have a Habbo object, you can use it to get more information about the Habbo.

Make sure to use the hhid (Habbo Unique ID).

profile, err := api.GetProfile(ctx, "com", "hhus-123456789")
if err != nil {
    // handle error
}

Habbo CLI

This projects also comes with a small command-line interface to fetch Habbos information as JSON.

$ go build -o go-habbo cmd/cli/main.go 
$ ./go-habbo <hotel> <habboName>

You can also run it straight from the source.

$ go run cmd/cli/main.go <hotel> <habboName>

The JSON is indented for readability and can be piped to a file or jq for further processing.

$ go run cmd/cli/main.go <hotel> <habboName> | jq .motto