1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
mod response;
use response::Root;
use crate::{utils::http_get_bz, VtClient, VtResult};
impl VtClient {
pub fn url_feed(&self, time: &str) -> VtResult<Vec<Root>> {
//! Get a URL feed batch.
//!
//! ## Example Usage
//! ```rust
//! use vt3::VtClient;
//!
//! let vt = VtClient::new("Your API Key");
//!
//! // A string in format YYYYMMDDhhmm
//! vt.url_feed("202106131355");
//! ```
let url = format!("{}/feeds/urls/{}", self.endpoint, time);
http_get_bz(&self.api_key, &self.user_agent, &url)
}
pub fn url_feed_hourly(&self, time: &str) -> VtResult<Vec<Root>> {
//! Hourly public_api.file feed batch.
//!
//! ## Example Usage
//! ```rust
//! use vt3::VtClient;
//!
//! let vt = VtClient::new("Your API Key");
//!
//! // A string in format YYYYMMDDhh
//! vt.url_feed("2021061313");
//! ```
let url = format!("{}/feeds/urls/hourly/{}", self.endpoint, time);
http_get_bz(&self.api_key, &self.user_agent, &url)
}
}