ExtractContent for Ruby 1.9+
Edit Gemfile.
$ vi Gemfile
Add a following line to Gemfile.
gem 'extractcontent', github: 'mono0x/extractcontent'
Install the gem.
$ bundle install
require 'bundler/setup'
require 'extractcontent'
html = ...
content, title = ExtractContent.analyse(html)
puts title
puts content
The BSD License
The original code was written by Nakatani Shuyo.