Skip to content

Instantly share code, notes, and snippets.

@spangenberg
Created October 27, 2011 19:28
Show Gist options
  • Save spangenberg/1320587 to your computer and use it in GitHub Desktop.
Save spangenberg/1320587 to your computer and use it in GitHub Desktop.
file = File.open('links.txt', 'rb')
contents = file.read
links = {}
contents.scan(/(http.*); (\d{1,2}.\d{1,2}.\d{4})/).each do |pattern|
links[pattern[0]] = pattern[1]
end
links.sort.each do |k, v|
puts "#{k}; #{v}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment