readability

Crates.ioreadability
lib.rsreadability
version0.3.0
sourcesrc
created_at2017-11-09 15:32:27.412724
updated_at2023-12-20 14:23:13.011761
descriptionPort of arc90's readability project to rust
homepagehttps://github.com/kumabook/readability
repositoryhttps://github.com/kumabook/readability.git
max_upload_size
id38749
size28,218
Hiroki Kumamoto (kumabook)

documentation

README

readability-rs

Build Status

readability-rs is a library for extracting the primary readable content of a webpage. This is a rust port of arc90's readability project. inspired by kingwkb/readability.

Hot to use

  • Add readability to dependencies in Cargo.toml
[dependencies]
readability = "^0"
  • Then, use it as below

extern crate readability;
use readability::extractor;

fn main() {
  match extractor::scrape("https://spincoaster.com/chromeo-juice") {
      Ok(product) => {
          println!("------- html ------");
          println!("{}", product.content);
          println!("---- plain text ---");
          println!("{}", product.text);
      },
      Err(_) => println!("error occured"),
  }
}

Demo

Visit demo page.

Related Projects

License

MIT

Commit count: 55

cargo fmt