Skip to content

Instantly share code, notes, and snippets.

@tijmenb
Created January 18, 2017 16:08
Show Gist options
  • Save tijmenb/ed65aa81027831975e68ea0556242bd3 to your computer and use it in GitHub Desktop.
Save tijmenb/ed65aa81027831975e68ea0556242bd3 to your computer and use it in GitHub Desktop.
# this should provide you with 20 random paths from each of the rendering apps on GOV.UK
#
# ssh content-store-1.integration
# govuk_app_console content-store
require 'yaml'
paths = []
ContentItem.distinct(:rendering_app).each do |rendering_app|
coll = ContentItem.where(rendering_app: rendering_app)
coll.skip(rand(coll.count)).limit(20).each do |content_item|
paths << content_item['base_path']
end
end
puts YAML.dump(paths)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment