Start ivago calendar endpoint
This commit is contained in:
parent
b42ea850cd
commit
c6d29f329c
5 changed files with 66 additions and 14 deletions
|
|
@ -1,5 +1,7 @@
|
|||
mod search;
|
||||
mod pickup_times;
|
||||
pub use search::{Street, search_streets};
|
||||
pub use pickup_times::{get_pickup_times, PickupTime};
|
||||
|
||||
|
||||
///// Return the known pickup times for the given street and/or city
|
||||
|
|
|
|||
|
|
@ -1,19 +1,27 @@
|
|||
use std::error::Error;
|
||||
use chrono::NaiveDate;
|
||||
use super::search::Street;
|
||||
|
||||
|
||||
const BASE_URL: &str = "https://www.ivago.be/nl/particulier/afval/ophaling";
|
||||
|
||||
|
||||
/// Represents a timezoneless date
|
||||
pub struct Date {
|
||||
day: u8,
|
||||
month: u8,
|
||||
year: u32,
|
||||
}
|
||||
|
||||
|
||||
/// Represents a pickup time instance. All fields are a direct map of the
|
||||
/// original API
|
||||
pub struct PickupTime {
|
||||
date: Date,
|
||||
date: NaiveDate,
|
||||
label: String,
|
||||
classes: Vec<String>,
|
||||
url: String
|
||||
}
|
||||
|
||||
|
||||
pub fn get_pickup_times(
|
||||
street: Street,
|
||||
number: u64,
|
||||
start_date: NaiveDate,
|
||||
end_date: NaiveDate
|
||||
) -> Result<Vec<PickupTime>, Box<dyn Error>> {
|
||||
Ok(Vec::new())
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue