Crate buongiornissimo_rs

Crate buongiornissimo_rs 

Source
Expand description

§buongiornissimo-rs

Buongiornissimo-rs is a Rust library to scrape for Buongiornissimo caffè Italian boomer flavoured images from a Rust application. It supports different buongiornissimo providers to scrape the images from. It supports many kind of “greetings”, such as the classic “buongiornissimo”, but also the holiday-based greetings, like “natale”, “sacro cuore di Gesù” and “Giovedì grasso”. Everthing is provided through a simple and totally async API.

§Features 🎁

  • Different providers to prevent api outages and to differentiate the contents.
  • Support for different kind of greetings based on the current date
  • Utilities functions to retrieve the moveable feasts date (such as Easter, Carnival, Corpus domini…). requires the moveable-feasts feature
  • A super comfy function greeting_of_the_day() to retrieve the best greeting for the day

§Get started

§Add buongiornissimo-rs to your Cargo.toml 🦀

buongiornissimo-rs = "^0.3"

Supported features are:

  • no-log: disable logging
  • moveable-feasts (default): enable getters for moveable feasts

§Scrape for buongiornissimo ☕

use buongiornissimo_rs::{BuongiornissimoCaffe, Scrape};
use chrono::Local;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let motd = buongiornissimo_rs::greeting_of_the_day(Local::today().naive_local(), true);
    let urls = BuongiornissimoCaffe::default().scrape(motd).await?;
    // Do whatever you want with the scraped images...
    Ok(())
}

Modules§

moveable_feasts
Moveable feasts

Structs§

Augurando
Buongiornissimo provider which scrapes images from https://augurando.it
BuongiornissimoCaffe
Buongiornissimo provider which scrapes images from https://www.buongiornissimocaffe.it.
BuongiornoImmagini
Buongiornissimo provider which scrapes images from https://buongiornoimmagini.it
TiCondivido
Buongiornissimo provider which scrapes images from https://ticondivido.it

Enums§

Greeting
Describes the Greeting type
ScrapeError
Scrape error

Traits§

Scrape
The Scrape trait defines the behaviour to scrape the images from the different boomer images providers

Functions§

greeting_of_the_day
A utility function to return the greeting for the day based on the current date (considers holiday).

Type Aliases§

ScrapeResult
Scrape trait result