manveru (owner)

Forks

Revisions

gist: 66717 Download_button fork
public
Description:
Download github wikis
Public Clone URL: git://gist.github.com/66717.git
Embed All Files: show embed
get-github-wiki.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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