Skip to content

Instantly share code, notes, and snippets.

@rrichards
Forked from manveru/get-github-wiki.rb
Created February 26, 2009 22:27
Show Gist options
  • Save rrichards/71167 to your computer and use it in GitHub Desktop.
Save rrichards/71167 to your computer and use it in GitHub Desktop.
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