flarer 0.1.0

Rust client and CLI for Cloudflare's Browser Rendering REST API (content, screenshot, PDF, snapshot, markdown, scrape, JSON extraction, links, crawl).
Documentation
//! Render a page to Markdown using the library API.
//!
//! Run with:
//! ```text
//! CF_ACCOUNT_ID=... CF_API_TOKEN=... \
//!   cargo run --example markdown -- https://example.com
//! ```

use flarer::{Account, Flarer, Tool};

#[tokio::main]
async fn main() -> flarer::Result<()> {
    let url = std::env::args()
        .nth(1)
        .unwrap_or_else(|| "https://example.com".to_string());

    let account = Account::from_env()?;
    let flarer = Flarer::builder().account(account).build()?;
    flarer.verify().await?;

    let out = flarer.run(Tool::Markdown, &url).await?;
    println!("{}", out.display_string());
    Ok(())
}