Webpage.rs

Get some info about a webpage

Usage

```rust extern crate webpage; use webpage::Webpage;

// ...

info = Webpage::from_url("http://www.rust-lang.org/en-US/");

// the HTTP info let http = info.http.unwrap();

asserteq!(http.ip, "54.192.129.71".tostring()); assert!(http.headers[0].startswith("HTTP")); assert!(http.body.startswith("")); asserteq!(http.url, "https://www.rust-lang.org/en-US/".tostring()); // followed redirects asserteq!(http.contenttype, "text/html".to_string());

// the HTML info let html = info.html.unwrap();

asserteq!(html.title.unwrap(), "The Rust Programming Language".tostring()); asserteq!(html.description.unwrap(), "A systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety.".tostring()); asserteq!(html.opengraph.ogtype, "website".to_string());