Skip to content

Instantly share code, notes, and snippets.

@igneus
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igneus/769815f814ca16675e49 to your computer and use it in GitHub Desktop.
Save igneus/769815f814ca16675e49 to your computer and use it in GitHub Desktop.
Koupaliště Petynka - teplota vzduchu, vody a počet návštěvníků bez otvírání webového prohlížeče
#!/usr/bin/env ruby
# 2015-05-09
#
# prints information from the Koupaliste Petynka's website
require 'mechanize' # interaction with websites
page = Mechanize.new.get('http://www.koupalistepetynka.cz/')
page.search('#tops .moduletable .udaje center').first.children.each do |e|
if e.is_a? Nokogiri::XML::Text
print e.text.strip
elsif e.is_a? Nokogiri::XML::Element
print ' '
puts e.text.strip
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment