| Crates.io | ezomyte |
| lib.rs | ezomyte |
| version | 0.0.2 |
| created_at | 2018-02-12 20:47:16.154336+00 |
| updated_at | 2018-03-29 16:07:30.959311+00 |
| description | Path of Exile API client library |
| homepage | https://github.com/Xion/ezomyte |
| repository | https://github.com/Xion/ezomyte |
| max_upload_size | |
| id | 50913 |
| size | 4,772,765 |
Client library for Path of Exile API
Warning: The crate is in early stages and the interface (esp. the data model for items) is likely to evolve over time.
Add ezomyte to your project's [dependencies] in Cargo.toml:
[dependencies]
ezomyte = "0.0.2"
ezomyte::Client provides access to various part of Path of Exile API:
public stashes (Client::stashes), current & past leagues (Client::leagues), and so on.
All endpoints return asynchronous Streams of structures
that has been deserialized from PoE API.
Here's a simple example of accessing public stash tabs
and looking for items with the unique rarity:
extern crate ezomyte;
extern crate futures;
extern crate tokio_core;
use ezomyte::Rarity;
use futures::Stream;
use tokio_core::reactor::Core;
fn main() {
let mut core = Core::new().unwrap();
let client = ezomyte::Client::new("ezomyte example", &core.handle());
core.run(
client.stashes().all().for_each(|stash| {
let uniques = stash.items.iter().filter(|i| i.rarity == Rarity::Unique);
for item in uniques {
// Prints something like "Belly of the Beast -- Full Wyrmscale".
println!("{} -- {}",
item.name.as_ref().map(|n| n.as_str()).unwrap_or("<unnamed>"),
item.base);
}
Ok(())
})
).unwrap();
}
See the examples directory for more examples.
Besides the current version of Rust compiler and Cargo, you would want:
cargo install just)apt-get install jq or similar)Running just will execute all the tests and compile examples.