Found a snippet that works for HTML Simple Dom Parser.
$el=$html->find('meta[http-equiv=Content-Type]',0);
$fullvalue = $el->content;
preg_match('/charset=(.+)/', $fullvalue, $matches);
echo $matches[1];
Can somebody help me to convert this so that this suits for Ruby and Nokogiri?