Git Product home page Git Product logo

poe-go's Introduction

poe-go

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. ๐Ÿ’ฐ

Getting Started

Prerequisites

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 and Git

Creating the Project

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

Project Directory

Create a new file named main.go by copying the contents of examples/poe-indexing-101/main.go:

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

go run

Nice! ๐Ÿ‘

Where to Go from Here

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.

Versioning

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.

License

This source is released under the MIT license (see the LICENSE file).

poe-go's People

Contributors

abesto avatar ccbrown avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

poe-go's Issues

other poe version,

I don't know how to use other poe version's api and change id, how you can teach me how to make it,Thank you

item.Name not leading to results? Not very tech savvy.

As subject states, I've tried running the indexer with a small modification, changing the if item.Type == "Ancient Reliquary Key" { line to if item.Name == "Tabula Rasa Simple Robe" for example but it leads to zero results even when poe.trade is constantly getting new Tabula's.

Just trying to figure this thing out for now as I'm terrible with computers.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.