Skip to content

Instantly share code, notes, and snippets.

@buren
Created June 14, 2018 15:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save buren/649c322ef6bcd7dd734d1171dc55ca9f to your computer and use it in GitHub Desktop.
Save buren/649c322ef6bcd7dd734d1171dc55ca9f to your computer and use it in GitHub Desktop.
Print Sitemap URLs
require 'open-uri'
require 'wayback_archiver' # requires `gem install wayback_archiver`
sitemap_urls = ARGV
sitemap_urls.map do |url|
sitemap_xml = open(url).read
sitemap = WaybackArchiver::Sitemap.new(sitemap_xml)
sitemap.urls
end.flat_map { |url| puts url }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment