You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Shadowfacts 75404b197d
Fix error when removing attributes from tree that contains comments
2 years ago
config Allow HTTPoison options to be specified in config 7 years ago
lib Fix error when removing attributes from tree that contains comments 2 years ago
test Fix error when removing attributes from tree that contains comments 2 years ago
.formatter.exs Add Elixir 1.6 formatter config file and formatted the codebase 6 years ago
.gitignore add ex_docs 8 years ago
.travis.yml Update minimum Elixir version requirement to 1.3.0 6 years ago
LICENSE Initial commit 8 years ago Updated README: minor grammar improvements as well as section for contributing 5 years ago
mix.exs Remove HTTPoison application 3 years ago
mix.lock Finish removing HTTPoison 2 years ago

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.


Build Status Readability version Deps Status

Readability is a tool for extracting and curating the primary readable content of a webpage.
Check out The Documentation for full and detailed guides


If available in Hex, the package can be installed as:

  1. Add readability to your list of dependencies in mix.exs:
def deps do
  [{:readability, "~> 0.9"}]
  1. Ensure readability is started before your application:
def application do
  [applications: [:readability]]

Note: Readability requires Elixir 1.3 or higher.



Just pass a url

url = ""
summary = Readability.summarize(url)

#=> "Why Im betting on Elixir"

#=> ["Ken Mazaika"]

# <div><div><p id=\"3476\"><strong><em>Background: </em></strong><em>Ive spent...
# ...
# ...button!</em></h3></div></div>

# Background: Ive spent the past 6 years building web applications in Ruby and.....
# ...
# ... value in this article, it would mean a lot to me if you hit the recommend button!

From raw html

### Extract the title.

### Extract authors.

### Extract the primary content with transformed html.
|> Readability.article
|> Readability.readable_html

### Extract only text from the primary content.
|> Readability.article
|> Readability.readable_text

### you can extract the primary images with Floki
|> Readability.article
|> Floki.find("img")
|> Floki.attribute("src")


If the result is different from your expectations, you can add options to customize it.


url = ""
summary = Readability.summarize(url, [clean_conditionally: false])
  • min_text_length \\ 25
  • remove_unlikely_candidates \\ true
  • weight_classes \\ true
  • clean_conditionally \\ true
  • retry_length \\ 250

You can find other algorithm and regex options in readability.ex


To run the test suite:

$ mix test


  • Extract authors
  • More configurable
  • Summarize function
  • Convert relative paths into absolute paths of img#src and a#href

Contributions are welcome!

Check out the main features milestone and features of related projects below


  1. Fork the repo on GitHub
  2. Clone the project to your own machine
  3. Commit changes to your own branch
  4. Push your work back up to your fork
  5. Submit a Pull request so that we can review your changes

NOTE: Be sure to merge the latest from "upstream" before making a pull request!

  • readability.js is a standalone version of the readability library used for Firefox Reader View.
  • newspaper is an advanced news extraction, article extraction, and content curation library for Python.
  • ruby-readability is a tool for extracting the primary readable content of a webpage.


This code is under the Apache License 2.0. See