#readability

readability

Port of arc90's readability project to rust

7 releases

Uses old Rust 2015

0.2.0 Apr 1, 2021
0.1.5 May 7, 2019
0.1.4 Feb 17, 2018
0.1.2 Nov 13, 2017

#765 in Text processing

Download history 15/week @ 2022-12-02 56/week @ 2022-12-09 23/week @ 2022-12-16 51/week @ 2022-12-23 19/week @ 2022-12-30 34/week @ 2023-01-06 21/week @ 2023-01-13 48/week @ 2023-01-20 44/week @ 2023-01-27 52/week @ 2023-02-03 52/week @ 2023-02-10 73/week @ 2023-02-17 30/week @ 2023-02-24 61/week @ 2023-03-03 40/week @ 2023-03-10 37/week @ 2023-03-17

174 downloads per month
Used in 4 crates

MIT license

26KB
668 lines

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.

License

MIT

Dependencies

~7–15MB
~325K SLoC