{"id":13411436,"url":"https://github.com/cantino/ruby-readability","last_synced_at":"2025-05-14T02:09:06.380Z","repository":{"id":803999,"uuid":"506837","full_name":"cantino/ruby-readability","owner":"cantino","description":"Port of arc90's readability project to Ruby","archived":false,"fork":false,"pushed_at":"2024-11-23T18:17:00.000Z","size":752,"stargazers_count":931,"open_issues_count":17,"forks_count":171,"subscribers_count":33,"default_branch":"master","last_synced_at":"2025-05-10T12:08:38.481Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cantino.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2010-02-07T20:08:01.000Z","updated_at":"2025-05-08T05:14:13.000Z","dependencies_parsed_at":"2024-01-13T03:01:45.862Z","dependency_job_id":"904528e7-46eb-4bd9-8e70-bde119c4e028","html_url":"https://github.com/cantino/ruby-readability","commit_stats":{"total_commits":176,"total_committers":37,"mean_commits":4.756756756756757,"dds":0.6875,"last_synced_commit":"e652671f9258f50ba6fc5491b2fc543d4dc3a9f9"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cantino%2Fruby-readability","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cantino%2Fruby-readability/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cantino%2Fruby-readability/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cantino%2Fruby-readability/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cantino","download_url":"https://codeload.github.com/cantino/ruby-readability/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254053237,"owners_count":22006717,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T20:01:13.649Z","updated_at":"2025-05-14T02:09:01.368Z","avatar_url":"https://github.com/cantino.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"Ruby Readability\n================\n\nRuby Readability is a tool for extracting the primary readable content of a\nwebpage. It is a Ruby port of arc90's readability project.\n\nBuild Status\n------------\n\n[![Ruby](https://github.com/cantino/ruby-readability/actions/workflows/ruby.yml/badge.svg?branch=master)](https://github.com/cantino/ruby-readability/actions/workflows/ruby.yml)\n\nInstall\n-------\n\nCommand line:\n\n    (sudo) gem install ruby-readability\n\nBundler:\n\n    gem \"ruby-readability\", :require =\u003e 'readability'\n\n\nExample\n-------\n\n    require 'rubygems'\n    require 'readability'\n    require 'open-uri'\n\n    source = URI.parse('http://lab.arc90.com/experiments/readability/').read\n    puts Readability::Document.new(source).content\n\n\nOptions\n-------\n\nYou may provide options to `Readability::Document.new`, including:\n\n* `:tags`: the base whitelist of tags to sanitize, defaults to `%w[div p]`;\n* `:remove_empty_nodes`: remove `\u003cp\u003e` tags that have no text content; also\n  removes `\u003cp\u003e` tags that contain only images;\n* `:attributes`: whitelist of allowed attributes;\n* `:debug`: provide debugging output, defaults false; supports setting a Proc;\n* `:encoding`: if the page is of a known encoding, you can specify it; if left\n   unspecified, the encoding will be guessed (only in Ruby 1.9.x). If you wish\n   to disable guessing, supply `:do_not_guess_encoding =\u003e true`;\n* `:html_headers`: in Ruby 1.9.x these will be passed to the\n   `guess_html_encoding` gem to aid with guessing the HTML encoding;\n* `:ignore_image_format`: for use with .images.  For example:\n  `:ignore_image_format =\u003e [\"gif\", \"png\"]`;\n* `:min_image_height`: set a minimum image height for `#images`;\n* `:min_image_width`: set a minimum image width for `#images`.\n* `:blacklist` and `:whitelist` allow you to explicitly scope to, or remove, CSS selectors.\n\n\nCommand Line Tool\n-----------------\n\nReadability comes with a command-line tool for experimentation in\n`bin/readability`.\n\n    Usage: readability [options] URL\n        -d, --debug                      Show debug output\n        -i, --images                     Keep images and links\n        -h, --help                       Show this message\n\n\nImages\n------\n\nYou can get a list of images in the content area with `Document#images`. This\nfeature requires that the `fastimage` gem be installed.\n\n    rbody = Readability::Document.new(body, :tags =\u003e %w[div p img a], :attributes =\u003e %w[src href], :remove_empty_nodes =\u003e false)\n    rbody.images\n\nRelated Projects\n----------------\n\n* [readability.cr](https://github.com/joenas/readability.cr) - Port of ruby-readability's port of arc90's readability project to Crystal\n* [newspaper](https://github.com/codelucas/newspaper) is an advanced news extraction, article extraction, and content curation library for Python.\n\nPotential Issues\n----------------\n\nIf you're on a Mac and are getting segmentation faults, see the discussion at\n\u003chttps://github.com/sparklemotion/nokogiri/issues/404\u003e and consider updating\nyour version of `libxml2`. Version 2.7.8 of `libxml2`, installed with `brew`,\nworked for me:\n\n    gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.7.8/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.7.8/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.26\n\nOr if you're using bundler and Rails 3, you can run this command to make\nbundler always globally build `nokogiri` this way:\n\n    bundle config build.nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.7.8/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.7.8/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.26\n\n\nLicense\n-------\n\nThis code is under the Apache License 2.0. See \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e.\n\nRuby port by cantino, starrhorne, libc, and iterationlabs. Special thanks to fizx and marcosinger.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcantino%2Fruby-readability","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcantino%2Fruby-readability","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcantino%2Fruby-readability/lists"}