/ Published in: Ruby
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#!/usr/bin/env ruby -wKU scope = STDIN.read scope.gsub!(/< \/?style.*?>/, '') open('|curl -sF file=@-\;type=text/css -F lang=en http://jigsaw.w3.org/css-validator/validator', 'r+') do |io| io < < scope io.close_write while io.gets $_.gsub!(/<\/title>/, '\&') print $_ end end