use microformats::from_html;
use url::Url;

fn main() {
    let html = r#"
    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8">
        <title>Vouch Page</title>
    </head>
    <body>
        <div class="h-entry">
            <a class="u-url" href="https://sender.com/post">Link to sender</a>
            <span class="p-name">I vouch for this person</span>
        </div>
    </body>
    </html>
    "#;

    let url = Url::parse("https://vouch.example.com").unwrap();
    let document = from_html(&html, &url).unwrap();

    println!("Items found: {}", document.items.len());
    for (i, item) in document.items.iter().enumerate() {
        println!("Item {}: {:?}", i, item.item_type);
        println!("Properties: {:#?}", item.properties);
    }
}
