Skip to content

Instantly share code, notes, and snippets.

@manveru
Created February 19, 2009 03:57
Show Gist options
  • Save manveru/66717 to your computer and use it in GitHub Desktop.
Save manveru/66717 to your computer and use it in GitHub Desktop.
Download github wikis
require 'open-uri'
require 'hpricot'
user, project = ARGV # 'tobi', 'liquid'
fail "get-github-wiki <username> <projectname>" unless user and project
uri = "http://wiki.github.com/#{user}/#{project}"
xpath = "div.sidebar/ul[1]//a"
command = %w[wget -t 2 -mkc --no-parent]
(Hpricot(open(uri))/xpath).each do |a|
cmd = command.dup << a[:href]
puts cmd
system(*cmd)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment