The goal of this library is to provide an entry-level guide to writing tools for PoE in the Go programming language.
It should be simple enough for anyone moderately computer savvy to follow and have their own stash tab indexer running in no time. 💰
Before doing anything else, you'll need to install Go and Git. Both provide installers that you can just spam-click "next" through.
Once both Go and Git are installed, open up "Git Bash" and verify that the "go" and "git" commands are available by typing go version
and git version
.
Go has relatively rigid project organization, so the project directory that we'll be working in needs to be made in your user directory's go/src directory.
Create a new project directory: mkdir -p ~/go/src/poe-indexing-101
Make it the current directory: cd ~/go/src/poe-indexing-101
Create a new file named main.go by copying the contents of examples/poe-indexing-101/main.go:
Finally, we'll build and run your first indexer.
Install dependencies (This will download and install this library.): go get -v .
Run main.go: go run main.go
Nice! 👍
As-is, this example isn't incredibly useful. You probably want to modify the processStash
function in main.go:
func processStash(stash *api.Stash) {
for _, item := range stash.Items {
if item.Type == "Ancient Reliquary Key" {
log.Printf("Ancient Reliquary Key: account = %v, league = %v, note = %v, tab = %v", stash.AccountName, item.League, item.Note, stash.Label)
}
}
}
You may want to filter by league, show the account's last character name, parse buyouts, play sounds, compose ready-to-whisper messages, etc.
You can refer to api/item.go and api/stash.go to see what data is available for you to use.
And if you're new to Go, you should probably read up a bit on how to write Go code.
This library is currently unversioned. There will never be any major breaking changes to the library, but stash and item fields may occasionally change to maintain accuracy and compatibility with the PoE API.
This source is released under the MIT license (see the LICENSE file).