diff --git a/project/src/backend.rs b/project/src/backend.rs index b64a45b..94d7880 100644 --- a/project/src/backend.rs +++ b/project/src/backend.rs @@ -1,8 +1,9 @@ // Libraries mod calculator; -use std::io::Result; - +mod scraper; use calculator::{CalculationResult, Calculator}; +use scraper::Scraper; +use std::io::Result; // Structures pub struct Backend { @@ -22,11 +23,18 @@ impl Backend { /// ```rs /// let backend = Backend::new(true)?; /// ``` - pub fn new(fetch: bool) -> Result { + pub async fn new(fetch: bool) -> Result { // Did we want to fetch our prices? let memberships: Vec = if fetch { - // Use Internet to get prices - unimplemented!("TODO: Implement online Membership Price Fetching"); + // Getting the URL to scrape from + let scrape_url = + "https://www.washluberepair.com/location/frederick-auto-spa-express-rt-85/"; + + // Fetching with our Scraper + let scraper = Scraper::new(scrape_url); + + // Scraping + scraper.start().await? } else { // Manually creating our prices vec![