#poe #response #wrapper #thin #api #url #path

yanked apiety

Thin wrapper around GGG's API for http://www.pathofexile.com/

Uses old Rust 2015

0.0.2 Oct 20, 2017
0.0.1 Oct 3, 2017

#12 in #poe

MIT license

14KB
163 lines

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...

Dependencies

~14–23MB
~359K SLoC