Skip to content

Instantly share code, notes, and snippets.

@MasonM
Created March 11, 2017 02:56
Show Gist options
  • Save MasonM/bea0f5c90aa6d172aa5d6e496db12187 to your computer and use it in GitHub Desktop.
Save MasonM/bea0f5c90aa6d172aa5d6e496db12187 to your computer and use it in GitHub Desktop.
Search confluence XML export using Nokogir
#!/bin/bash
nokogiri entities.xml -e '
# Based on https://github.com/locationtech/udig-platform/blob/4b926e7bd35d4c95ee2b7a4d1c3294cc3c2729a7/docs/src/main/java/docs/ConfluencePage.java#L103
current_pages=%{
//object[
@class="Page"
and property[@name="contentStatus" and .="current"]
and (
collection[@name="historicalVersions"]
or (
property[@name="version" and .="1"]
and not(property[@name="originalVersion"])
)
)
]
}.gsub(/\s+/, " ").strip
p '+"$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment