Created
January 19, 2017 00:32
-
-
Save davidcornu/c2d0b325bba267aaa91ee4ac2012310f to your computer and use it in GitHub Desktop.
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 characters
source "https://rubygems.org" | |
gem 'oga' |
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 characters
GEM | |
remote: https://rubygems.org/ | |
specs: | |
ansi (1.5.0) | |
ast (2.3.0) | |
oga (2.8) | |
ast | |
ruby-ll (~> 2.1) | |
ruby-ll (2.1.2) | |
ansi | |
ast | |
PLATFORMS | |
ruby | |
DEPENDENCIES | |
oga | |
BUNDLED WITH | |
1.13.6 |
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 characters
require 'open-uri' | |
require 'oga' | |
(1970..1990).each do |year| | |
body = URI("http://www.meertens.knaw.nl/nvb/topnamen/land/Nederland/#{year}").open.read | |
doc = Oga.parse_html(body) | |
doc.css('#topnamen-jongens tr').each do |row| | |
next unless row.text.include?('Willem') | |
puts "##{row.css('td')[0].text} in #{year}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment