[ANN] W3CHTMLValidator v0.1.0

D

Damphyr

This is a mini-module that does not merit a RubyForge project but might
come in handy.
It's a module to facilitate HTML markup validation using the W3C Markup
validation Service.
I use it to automate validation for my websites, i.e. in a rake task I
do something like the following

require 'validator'
#targets is an array of URIs to the pages we want to validate
results=Hash.new
targets.each{|t|
res=W3CHTMLValidator.validate_page(page)
#any page with problems goes into the hash
results[page]=res.messages unless res.ok?
}
#do something with the results

Check it out at http://www.braveworld.net/riva/work/validator/index.html
Have fun,
V.-

--
http://www.braveworld.net/riva

____________________________________________________________________
http://www.freemail.gr - äùñåÜí õðçñåóßá çëåêôñïíéêïý ôá÷õäñïìåßïõ.
http://www.freemail.gr - free email service for the Greek-speaking.
 
D

Damphyr

Whoa! Lots of typos there. The code should look like this:

require 'validator'
#targets is an array of URIs to the pages we want to validate
results=Hash.new
targets.each{|t|
res=W3CHTMLValidator.validate_page(t)
#any page with problems goes into the hash
results[t]=res.messages unless res.ok?
}
#do something with the results

Look what happens when you post while refactoring.
Cheers,
V.-
--
http://www.braveworld.net/riva

____________________________________________________________________
http://www.freemail.gr - äùñåÜí õðçñåóßá çëåêôñïíéêïý ôá÷õäñïìåßïõ.
http://www.freemail.gr - free email service for the Greek-speaking.
 

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

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top