This post originated from an RSS feed registered with Ruby Buzz
by Francis Hwang.
Original Post: HtmlClipping 0.1.0
Feed Title: Francis Hwang's site: ruby
Feed URL: http://fhwang.net/syndicate/ruby.atom
Feed Description: Author & artist Francis Hwang's personal site.
More Ruby libs: I’ve just released the first version of HtmlClipping. HtmlClipping reads an HTML page that has a link pointing to a particular URI. It removes most HTML markup, bolds the link text, and trims the resulting text to a fixed number of characters. I developed it to help me track referers to my website, though I suppose it might have other uses.
require 'htmlclipping'
require 'net/http'
contents = ''
Net::HTTP.start( 'rubyforge.org' ) do |http|
response = http.get '/credits/'
contents = response.body
end
clipping = HtmlClipping.new(
contents, 'http://www.rubycentral.org/pledge/', 500
)
puts clipping.to_s
=> "… RubyForge takes time, effort, and money. Many thanks to the
folks listed below who are making it possible! If RubyForge has
been helpful to you, and you want to give something back to the Ruby
community, please consider supporting RubyCentral.
Thanks! InfoEther, Inc purchased the RubyForge hardware and
provides system administration support. Several folks provide
file mirrors to help share the bandwidth load: Evan Webb
Dennis Oelkers Austin …"