Skip to content

Instantly share code, notes, and snippets.

@andrew
Created April 25, 2009 12:08
Show Gist options
  • Save andrew/101599 to your computer and use it in GitHub Desktop.
Save andrew/101599 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'garb' # http://github.com/vigetlabs/garb/
Garb::Session.login('[email protected]', 'password')
site = Garb::Profile.all.first
puts "Top 10 uri's in the past day on #{site.title}:"
r = Garb::Report.new(site)
r.metrics << :pageviews
r.dimensions << :request_uri
r.sort << :pageviews.desc
r.max_results = 10
r.start_date = Time.now - (86400)
r.end_date = Time.now
for v in r.all
puts "#{v.request_uri} (#{v.pageviews})"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment