Created
September 6, 2011 16:01
Revisions
-
Priit Haamer revised this gist
Sep 28, 2011 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,5 +10,8 @@ doc.css('table.contentpaneopen:nth-child(2) p').each do |p| print = false if p.text =~ /Sinu NOIR/ print = true if p.text =~ /PAKKUMINE/ if print p.search('br').each{ |br| br.replace(Nokogiri::XML::Text.new("\n", p.document)) } puts p.text end end -
Priit Haamer revised this gist
Sep 7, 2011 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,5 +10,5 @@ doc.css('table.contentpaneopen:nth-child(2) p').each do |p| print = false if p.text =~ /Sinu NOIR/ print = true if p.text =~ /PAKKUMINE/ puts p.text.gsub(/[\s ]+/, ' ') if print end -
Priit Haamer created this gist
Sep 6, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ #!/usr/bin/env ruby require 'rubygems' require 'nokogiri' require 'open-uri' print = false doc = Nokogiri::HTML(open("http://www.cafenoir.ee/noir/")) doc.css('table.contentpaneopen:nth-child(2) p').each do |p| print = false if p.text =~ /Sinu NOIR/ print = true if p.text =~ /PAKKUMINE/ puts p.text if print end