[ANN] HtmlClipping 0.1.0

F

Francis Hwang

Hi all,

I've just released the first version of HtmlClipping.

== What's HtmlClipping?

HtmlClipping is a library for reading 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.

For example, the following script gets the HTML at
rubyforge.org/credits/, and forms an excerpt around the link to
www.rubycentral.org/pledge/.

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! <br /> If RubyForge
has
been helpful to you, and you want to give something back to the
Ruby
community, please consider supporting <strong>RubyCentral</strong>.
Thanks! <br /> InfoEther, Inc purchased the RubyForge hardware and
provides system administration support. <br /> Several folks
provide
file mirrors to help share the bandwidth load: <br /> Evan Webb
<br />
Dennis Oelkers <br /> Austin …"

http://rubyforge.org/projects/htmlclipping

Francis Hwang
http://fhwang.net/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

[ANN] openssl-nonblock 0.1.0 0
[ANN] ClothRed 0.1.0 released 0
[ANN] MagickWand for Ruby 0.1.0 2
Help with code 0
[ANN] Elif 0.1.0 Released 0
[ANN] ruport-util 0.1.0 0
[ANN] Logging 0.1.0 5
[ANN] RWEB 0.1.0 2

Members online

Forum statistics

Threads
474,166
Messages
2,570,907
Members
47,448
Latest member
DeanaQ4445

Latest Threads

Top