我具有由W3C在JBoss本地运行提供的CSS-validator.war。

我已搅打一起非常快的脚本来测试它:

require 'net/http'
require 'uri'

doc = '
* html {
    font-family: tahoma;
    background-color: black;
}
'

res = Net::HTTP.post_form(URI.parse('http://localhost:8080/css-validator/validator'),
  {'uri' => 'none', 'profile' => 'css2','usermedium' => 'all', 'type' => 'none', 'lang' => 'en', 'warning' => '1', 'output' => 'soap12', 'text' => doc})

response = res.body

puts response

在我的浏览器在网页浏览器验证我可以粘贴在精细的CSS和验证很好,但是当我运行此脚本,我得到一个错误页面,指出:

  

I / O错误:您发送了一个无效   请求。

我已签,我传递的参数,他们似乎罚款。

有没有人有任何想法,为什么这会发生?

干杯

EEF

有帮助吗?

解决方案

我发现了一个称为w3c_validators宝石提供CSS,标记和订阅验证。

gem install w3c_validators

希望有人认为这是有用的。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top