Skip to content

Instantly share code, notes, and snippets.

@techmaniack
Last active June 1, 2017 11:45
Show Gist options
  • Save techmaniack/4143094 to your computer and use it in GitHub Desktop.
Save techmaniack/4143094 to your computer and use it in GitHub Desktop.
Grab all tutorials files from dev.origami.org
#! /usr/bin/env ruby
require 'mechanize'
agent = Mechanize.new
url = "http://dev.origami.org/diagram.cfm?CurrentPage="
base = "http://dev.origami.org/"
21.times do |count|
puts url+"#{count}"
page = agent.get(url+"#{count+1}")
page.links.each do |l|
`wget -c #{base}#{l.uri.to_s} -O #{l.uri.to_s[25..-1]}` if l.uri.to_s.end_with?"pdf"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment