Compare commits

..

No commits in common. "5d5df73b7c12daf8e2299b89c81c3f24b0bece01" and "9892b663d25103a74fe5bce65255255959786eea" have entirely different histories.

2 changed files with 7 additions and 17 deletions

View file

@ -1,10 +1,9 @@
// Libraries // Libraries
mod calculator; mod calculator;
mod scraper;
use calculator::{CalculationResult, Calculator};
use scraper::Scraper;
use std::io::Result; use std::io::Result;
use calculator::{CalculationResult, Calculator};
// Structures // Structures
pub struct Backend { pub struct Backend {
memberships: Vec<String>, memberships: Vec<String>,
@ -23,18 +22,11 @@ impl Backend {
/// ```rs /// ```rs
/// let backend = Backend::new(true)?; /// let backend = Backend::new(true)?;
/// ``` /// ```
pub async fn new(fetch: bool) -> Result<Self> { pub fn new(fetch: bool) -> Result<Self> {
// Did we want to fetch our prices? // Did we want to fetch our prices?
let memberships: Vec<String> = if fetch { let memberships: Vec<String> = if fetch {
// Getting the URL to scrape from // Use Internet to get prices
let scrape_url = unimplemented!("TODO: Implement online Membership Price Fetching");
"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 { } else {
// Manually creating our prices // Manually creating our prices
vec![ vec![

View file

@ -5,13 +5,11 @@ mod backend;
use backend::Backend; use backend::Backend;
use std::io::Result; use std::io::Result;
use std::rc::Rc; use std::rc::Rc;
use tokio;
// Entry Point // Entry Point
#[tokio::main] fn main() -> Result<()> {
async fn main() -> Result<()> {
// Creating a Backend // Creating a Backend
let backend = Rc::new(Backend::new(true).await?); let backend = Rc::new(Backend::new(false)?);
// Creating a new App // Creating a new App
let app = App::new(Rc::clone(&backend))?; let app = App::new(Rc::clone(&backend))?;