Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Puts loc entry in sitemap_index.xml.gz

View gist:4085015

Puts loc entry in sitemap_index.xml.gz

##
# Usage: puts_locs `file`
# Puts loc entry in sitemap_index.xml.gz
# 
function _puts_locs() {
  zcat $1 | \
  ruby -anle '$_.sub(/^.*?<loc>/, "").gsub(/<loc>/, "\n").split("\n").each{|l| puts l.sub(/<\/loc>.*$/, "") }'
}

function _path_of() {
  echo $1 | sed 's|.*/sitemap|public/sitemap|' 
}

function puts_locs() {
  for sitemap in `_puts_locs $1`; do
    _puts_locs `_path_of $sitemap`
  done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.