apiety

Crates.ioapiety
lib.rsapiety
version0.0.2
sourcesrc
created_at2017-10-03 00:58:07.80072
updated_at2017-10-20 21:31:01.61512
descriptionThin wrapper around GGG's API for http://www.pathofexile.com/
homepagehttps://gitlab.com/quarry-map/apiety
repositoryhttps://gitlab.com/quarry-map/apiety.git
max_upload_size
id34214
size15,725
Benjamin Bäumler (qqwa)

documentation

README

apiety

Thin wrapper around GGG's API for Path of Exile

Table of contents

  1. Description
  2. Endpoints
  3. Contributing

Description

Goal of this library is it to provide an easy way to get started writing tools for Path of Exile. It provides statically typed structs to deserialize the json responses. Those structs can be used to get started but should probably be replaced later to only contain the data that you care about.

apiety provides fn cache_body<T: Endpoint>(endpoint: &T) -> Result<String> which can be used to test your code without downloading the same data over and over.
NOTE this will serve from cache if it finds a file with the same url as the passed endpoint, even if it would not make sense. E.g. id?=42 returning next_change_id=42

let mut endpoint = apiety::stash::public::Endpoint::new("0");
for _ in 0..100 {
    // can be later changed to get_body for production ready code
    let body = apiety::cache_body(&endpoint).unwrap();
    let response = apiety::stash::public::Endpoint::deserialize(body.as_str()).unwrap();
    endpoint = apiety::stash::public::Endpoint::new(response.next_change_id.as_str());
    for stash in response.stashes {
        //try stuff
        println!("{}", stash.id);
    }
}

Endpoints

Only the endpoint for public stash tabs is implemented. Check the wiki for more informations about endpoints.

Contributing

Any form of contribution is welcome. Opening issues, requesting features, sending pull requests, etc...

Commit count: 0

cargo fmt