readability-fork

Crates.ioreadability-fork
lib.rsreadability-fork
version0.2.2
sourcesrc
created_at2020-05-25 03:44:41.50135
updated_at2021-01-06 09:13:58.689975
descriptionTemporary fork of 'readability' crate with updated dependencies
homepagehttps://github.com/jangernert/readability
repositoryhttps://github.com/jangernert/readability.git
max_upload_size
id245442
size27,482
Jan Lukas Gernert (jangernert)

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

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: 53

cargo fmt