Skip to content

Instantly share code, notes, and snippets.

@emasaka
Created May 29, 2011 06:52
Show Gist options
  • Save emasaka/997528 to your computer and use it in GitHub Desktop.
Save emasaka/997528 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'open-uri'
require 'nokogiri'
SOURCE = 'http://httpd.apache.org/docs/2.2/mod/quickreference.html'
DEST = 'apache.dict'
list = []
open(SOURCE) do |io|
Nokogiri.HTML(io).xpath('//table[@class="qref"]/tr/td[1]').each do |td|
list << td.text.split[0].delete('<') unless td['class'] == 'descr'
end
end
open(DEST, 'w') do |io|
list.sort.each {|e| io.puts e }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment