diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2018-09-23 19:08:06 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2018-09-23 19:38:50 +0200 |
commit | f50dfd5045170e1435270e6de3a03a74807ee392 (patch) | |
tree | 3a4a4185cecf54186f7c549243e16f5d5cfe7705 /src/client.rs | |
parent | 5b740a7a2a50f049619797c9e4fcd7815fea259e (diff) | |
download | rust-zotapi-f50dfd5045170e1435270e6de3a03a74807ee392.tar.gz rust-zotapi-f50dfd5045170e1435270e6de3a03a74807ee392.tar.bz2 rust-zotapi-f50dfd5045170e1435270e6de3a03a74807ee392.zip |
Begin implementaton of undocumented abook api to fetch connections.
Diffstat (limited to 'src/client.rs')
-rw-r--r-- | src/client.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/client.rs b/src/client.rs index 098c0ac..f181e65 100644 --- a/src/client.rs +++ b/src/client.rs @@ -24,8 +24,10 @@ use reqwest::{ use serde::Serialize; use serde_urlencoded; use std::io::Read; +use abook::AbookFetcher; use xchan::XChanFetcher; +pub const ZOTAPI_ABOOK_PATH : &str = "/api/z/1.0/abook"; pub const ZOTAPI_CHANNEL_STREAM_PATH : &str = "/api/z/1.0/channel/stream"; pub const ZOTAPI_NETWORK_STREAM_PATH : &str = "/api/z/1.0/network/stream"; pub const ZOTAPI_ITEM_UPDATE_PATH : &str = "/api/z/1.0/item/update"; @@ -48,6 +50,10 @@ impl Client { } } + pub fn abook(&self) -> AbookFetcher { + AbookFetcher::new(self) + } + pub fn channel_stream(&self) -> Result<String, Error> { self.fetch_stream(ZOTAPI_CHANNEL_STREAM_PATH, &()) } |