gauges 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,6 @@
1
+ log/*
2
+ *.gem
3
+ .bundle
4
+ Gemfile.lock
5
+ pkg/*
6
+ specs.watchr
data/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ source "http://rubygems.org"
2
+ gemspec
3
+
4
+ group(:test) do
5
+ gem 'rake', '~> 0.8.7'
6
+ gem 'rspec', '~> 2.3'
7
+ gem 'log_buddy', '~> 0.5.0'
8
+ gem 'fakeweb', '~> 1.3.0'
9
+ end
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 John Nunemaker
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,17 @@
1
+ = Gaug.es
2
+
3
+ Ruby gem that gives you easy access to the Gaug.es API.
4
+
5
+ More coming soon, when it actually does something...
6
+
7
+ == Note on Patches/Pull Requests
8
+
9
+ * Fork the project.
10
+ * Make your feature addition or bug fix.
11
+ * Add tests for it. This is important so I don't break it in a future version unintentionally.
12
+ * Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
13
+ * Send me a pull request. Bonus points for topic branches.
14
+
15
+ == Copyright
16
+
17
+ See LICENSE for details.
@@ -0,0 +1,7 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ require 'rspec/core/rake_task'
5
+ RSpec::Core::RakeTask.new
6
+
7
+ task :default => :spec
@@ -0,0 +1,9 @@
1
+ $LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
2
+ require 'pp'
3
+ require 'rubygems'
4
+ require 'gauges'
5
+
6
+ ga = Gauges.new(:token => '...')
7
+ pp ga.clients
8
+ pp ga.create_client(:description => 'Testing')
9
+ pp ga.clients
@@ -0,0 +1,19 @@
1
+ $LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
2
+ require 'pp'
3
+ require 'rubygems'
4
+ require 'gauges'
5
+
6
+ id = '4d5f4992089bb618a2000005'
7
+ ga = Gauges.new(:token => '...')
8
+
9
+ response = ga.content(id)
10
+ pp response['content'].size
11
+
12
+ response = ga.content(id, :page => 2)
13
+ pp response['content'].size
14
+
15
+ response = ga.content(id, :page => 3)
16
+ pp response['content'].size
17
+
18
+ response = ga.content(id, :date => '2011-08-01')
19
+ pp response['content'].size
@@ -0,0 +1,38 @@
1
+ $LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
2
+ require 'pp'
3
+ require 'rubygems'
4
+ require 'gauges'
5
+
6
+ ga = Gauges.new(:token => '...')
7
+
8
+ puts 'Listing gauges'
9
+ pp ga.gauges.map { |gauge| gauge['title'] }
10
+ puts
11
+
12
+ puts 'Creating gauge'
13
+ gauge = ga.create_gauge({
14
+ :title => 'Testing',
15
+ :tz => 'Eastern Time (US & Canada)'
16
+ })
17
+ pp gauge['title']
18
+ puts
19
+
20
+ puts 'Listing gauges'
21
+ pp ga.gauges.map { |gauge| gauge['title'] }
22
+ puts
23
+
24
+ puts 'Get gauge'
25
+ pp ga.gauge(gauge['id'])['title']
26
+ puts
27
+
28
+ puts 'Update gauge'
29
+ pp ga.update_gauge(gauge['id'], :title => 'New Title')['title']
30
+ puts
31
+
32
+ puts 'Get gauge'
33
+ pp ga.gauge(gauge['id'])['title']
34
+ puts
35
+
36
+ puts 'Deleting gauge'
37
+ pp ga.delete_gauge(gauge['id'])['title']
38
+ puts
@@ -0,0 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "gauges/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "gauges"
7
+ s.version = Gauges::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ['John Nunemaker']
10
+ s.email = ['nunemaker@gmail.com']
11
+ s.homepage = ""
12
+ s.summary = %q{Simple access to Gaug.es API}
13
+ s.description = %q{Simple access to Gaug.es API}
14
+
15
+ s.add_dependency('httparty', '~> 0.7.8')
16
+
17
+ s.files = `git ls-files`.split("\n")
18
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
+ s.require_paths = ["lib"]
21
+ end
@@ -0,0 +1,133 @@
1
+ require 'httparty'
2
+
3
+ class Gauges
4
+ include HTTParty
5
+
6
+ base_uri 'https://secure.gaug.es'
7
+
8
+ # :token => http://get.gaug.es/documentation/api/authentication/
9
+ def initialize(options={})
10
+ @options = options
11
+ end
12
+
13
+ def me
14
+ get('/me')
15
+ end
16
+
17
+ # :first_name, :last_name
18
+ def update_me(params={})
19
+ put('/me', params)
20
+ end
21
+
22
+ def clients
23
+ get('/clients')
24
+ end
25
+
26
+ # :description => Any text describing what this client is or will be used for (ie: Campfire, GitHub, HipChat...)
27
+ def create_client(params={})
28
+ post('/clients', params)
29
+ end
30
+
31
+ def delete_client(id)
32
+ delete("/clients/#{id}")
33
+ end
34
+
35
+ def gauges
36
+ get('/gauges')
37
+ end
38
+
39
+ # :title => The title of the gauge (ie: RailsTips)
40
+ # :tz => The time zone stats should be tracked in
41
+ def create_gauge(params={})
42
+ post('/gauges', params)
43
+ end
44
+
45
+ def gauge(id)
46
+ get("/gauges/#{id}")
47
+ end
48
+
49
+ def update_gauge(id, params={})
50
+ put("/gauges/#{id}", params)
51
+ end
52
+
53
+ def delete_gauge(id)
54
+ delete("/gauges/#{id}")
55
+ end
56
+
57
+ def shares(id)
58
+ get("/gauges/#{id}/shares")
59
+ end
60
+
61
+ # :email => The email of the user to add
62
+ def share(id, params={})
63
+ post("/gauges/#{id}/shares", params)
64
+ end
65
+
66
+ def unshare(id, user_id)
67
+ delete("/gauges/#{id}/shares/#{user_id}")
68
+ end
69
+
70
+ def content(id, params={})
71
+ get("/gauges/#{id}/content", params)
72
+ end
73
+
74
+ def referrers(id, params={})
75
+ get("/gauges/#{id}/referrers", params)
76
+ end
77
+
78
+ def traffic(id, params={})
79
+ get("/gauges/#{id}/traffic", params)
80
+ end
81
+
82
+ def resolutions(id, params={})
83
+ get("/gauges/#{id}/resolutions", params)
84
+ end
85
+
86
+ def technology(id, params={})
87
+ get("/gauges/#{id}/technology", params)
88
+ end
89
+
90
+ def terms(id, params={})
91
+ get("/gauges/#{id}/terms")
92
+ end
93
+
94
+ def engines(id, params={})
95
+ get("/gauges/#{id}/engines", params)
96
+ end
97
+
98
+ def locations(id, params={})
99
+ get("/gauges/#{id}/locations", params)
100
+ end
101
+
102
+ def token
103
+ @options[:token]
104
+ end
105
+
106
+ def url(url)
107
+ host, *parts = url.gsub(/https?\:\/\//, '').split('/')
108
+ get("/#{parts.join('/')}")
109
+ end
110
+
111
+ private
112
+ def get(path, params={})
113
+ self.class.get(path, options(:query => params))
114
+ end
115
+
116
+ def post(path, body={})
117
+ self.class.post(path, options(:body => body))
118
+ end
119
+
120
+ def put(path, body={})
121
+ self.class.put(path, options(:body => body))
122
+ end
123
+
124
+ def delete(path)
125
+ self.class.delete(path, options)
126
+ end
127
+
128
+ def options(hash={})
129
+ hash[:headers] ||= {}
130
+ hash[:headers]['X-Gauges-Token'] = token
131
+ hash
132
+ end
133
+ end
@@ -0,0 +1,3 @@
1
+ class Gauges
2
+ VERSION = '0.1.0'
3
+ end
@@ -0,0 +1,5 @@
1
+ HTTP/1.1 201 Created
2
+ Content-Type: application/json
3
+ Connection: close
4
+
5
+ {"client":{"created_at":"2011-11-02T15:17:53Z","urls":{"self":"https://secure.gaug.es/clients/6c6b748646bb371a0027683cda32b7ff"},"description":"HipChat","key":"6c6b748646bb371a0027683cda32b7ff"}}
@@ -0,0 +1,5 @@
1
+ HTTP/1.1 200 OK
2
+ Content-Type: application/json
3
+ Connection: keep-alive
4
+
5
+ {"client":{"created_at":"2011-11-02T15:17:53Z","urls":{"self":"https://secure.gaug.es/clients/6c6b748646bb371a0027683cda32b7ff"},"description":"HipChat","key":"6c6b748646bb371a0027683cda32b7ff"}}
@@ -0,0 +1,5 @@
1
+ HTTP/1.1 200 OK
2
+ Content-Type: application/json
3
+ Connection: close
4
+
5
+ {"clients":[{"created_at":"2011-11-02T15:17:53Z","urls":{"self":"https://secure.gaug.es/clients/6c6b748646bb371a0027683cda32b7ff"},"description":"HipChat","key":"6c6b748646bb371a0027683cda32b7ff"}]}
@@ -0,0 +1,5 @@
1
+ HTTP/1.1 401 Authorization Required
2
+ Content-Type: application/json
3
+ Connection: close
4
+
5
+ {"status":"fail","message":"Authentication required"}
@@ -0,0 +1,5 @@
1
+ HTTP/1.1 200 OK
2
+ Content-Type: application/json
3
+ Connection: keep-alive
4
+
5
+ {"urls":{"older":"https://secure.gaug.es/gauges/4d597dfd6bb4ba2c48000003/content?date=2011-11-01","previous_page":null,"next_page":null,"newer":null},"date":"2011-11-02","page":1,"content":[{"title":"HipChat, hubot, and Me // acme.com","views":31,"path":"/blog/archives/2011/10/28/hipchat-hubot-and-me/","host":"acme.com"},{"title":"hubot Scripts Explained // acme.com","views":11,"path":"/blog/archives/2011/10/28/hubot-scripts-explained/","host":"acme.com"},{"title":"Compiling Executables on Heroku // acme.com","views":6,"path":"/blog/archives/2011/07/28/running-pdftotext-on-heroku/","host":"acme.com"},{"title":"Home // acme.com","views":1,"path":"/","host":"acme.com"},{"title":"Mentors // acme.com","views":1,"path":"/blog/archives/2011/10/20/mentors/","host":"acme.com"},{"title":"Archives // acme.com","views":1,"path":"/blog/archives/","host":"acme.com"},{"title":"July 2011 // acme.com","views":1,"path":"/blog/archives/2011/07/","host":"acme.com"},{"title":"Launching Speaker Deck // acme.com","views":1,"path":"/blog/archives/2011/10/10/launching-speaker-deck/","host":"acme.com"}],"per_page":50}
@@ -0,0 +1,5 @@
1
+ HTTP/1.1 200 OK
2
+ Content-Type: application/json
3
+ Connection: keep-alive
4
+
5
+ {"urls":{"older":"https://secure.gaug.es/gauges/4d597dfd6bb4ba2c48000003/engines?date=2011-10-01","newer":null},"date":"2011-11-02","engines":[{"title":"Google","views":90,"key":"google"}]}
@@ -0,0 +1,5 @@
1
+ HTTP/1.1 200 OK
2
+ Content-Type: application/json
3
+ Connection: keep-alive
4
+
5
+ {"gauge":{"recent_months":[{"views":190,"date":"2011-11-01","people":82},{"views":2452,"date":"2011-10-01","people":1517},{"views":868,"date":"2011-09-01","people":488},{"views":562,"date":"2011-08-01","people":269},{"views":3287,"date":"2011-07-01","people":2640},{"views":224,"date":"2011-06-01","people":133},{"views":143,"date":"2011-05-01","people":105},{"views":86,"date":"2011-04-01","people":52},{"views":367,"date":"2011-03-01","people":144},{"views":80,"date":"2011-02-01","people":44}],"today":{"views":53,"date":"2011-11-02","people":29},"title":"acme.com","urls":{"shares":"https://secure.gaug.es/gauges/4d597dfd6bb4ba2c48000003/shares","referrers":"https://secure.gaug.es/gauges/4d597dfd6bb4ba2c48000003/referrers","self":"https://secure.gaug.es/gauges/4d597dfd6bb4ba2c48000003","technology":"https://secure.gaug.es/gauges/4d597dfd6bb4ba2c48000003/technology","content":"https://secure.gaug.es/gauges/4d597dfd6bb4ba2c48000003/content","locations":"https://secure.gaug.es/gauges/4d597dfd6bb4ba2c48000003/locations","engines":"https://secure.gaug.es/gauges/4d597dfd6bb4ba2c48000003/engines","terms":"https://secure.gaug.es/gauges/4d597dfd6bb4ba2c48000003/terms","resolutions":"https://secure.gaug.es/gauges/4d597dfd6bb4ba2c48000003/resolutions","traffic":"https://secure.gaug.es/gauges/4d597dfd6bb4ba2c48000003/traffic"},"recent_hours":[{"hour":"21","views":0,"people":0},{"hour":"20","views":0,"people":0},{"hour":"19","views":0,"people":0},{"hour":"18","views":0,"people":0},{"hour":"17","views":0,"people":0},{"hour":"16","views":0,"people":0},{"hour":"15","views":0,"people":0},{"hour":"14","views":0,"people":0},{"hour":"13","views":0,"people":0},{"hour":"12","views":0,"people":0},{"hour":"11","views":1,"people":1},{"hour":"10","views":8,"people":4},{"hour":"09","views":12,"people":9},{"hour":"08","views":9,"people":6},{"hour":"07","views":1,"people":0},{"hour":"06","views":4,"people":3},{"hour":"05","views":3,"people":0},{"hour":"04","views":0,"people":0},{"hour":"03","views":1,"people":1},{"hour":"02","views":7,"people":4},{"hour":"01","views":3,"people":3},{"hour":"00","views":4,"people":2},{"hour":"23","views":15,"people":6},{"hour":"22","views":7,"people":5}],"yesterday":{"views":137,"date":"2011-11-01","people":72},"all_time":{"views":8259,"people":5349},"id":"4d597dfd6bb4ba2c48000003","creator_id":"4df37acbe5947cabdd000001","enabled":true,"tz":"Eastern Time (US & Canada)","recent_days":[{"views":53,"date":"2011-11-02","people":29},{"views":137,"date":"2011-11-01","people":72},{"views":154,"date":"2011-10-31","people":108},{"views":70,"date":"2011-10-30","people":39},{"views":310,"date":"2011-10-29","people":186},{"views":360,"date":"2011-10-28","people":233},{"views":16,"date":"2011-10-27","people":11},{"views":17,"date":"2011-10-26","people":12},{"views":19,"date":"2011-10-25","people":13},{"views":10,"date":"2011-10-24","people":9},{"views":2,"date":"2011-10-23","people":2},{"views":6,"date":"2011-10-22","people":6},{"views":19,"date":"2011-10-21","people":11},{"views":65,"date":"2011-10-20","people":49},{"views":13,"date":"2011-10-19","people":11},{"views":8,"date":"2011-10-18","people":5},{"views":22,"date":"2011-10-17","people":18},{"views":24,"date":"2011-10-16","people":16},{"views":133,"date":"2011-10-15","people":113},{"views":366,"date":"2011-10-14","people":335},{"views":27,"date":"2011-10-13","people":19},{"views":19,"date":"2011-10-12","people":13},{"views":17,"date":"2011-10-11","people":9},{"views":80,"date":"2011-10-10","people":46},{"views":33,"date":"2011-10-09","people":8},{"views":20,"date":"2011-10-08","people":9},{"views":29,"date":"2011-10-07","people":16},{"views":143,"date":"2011-10-06","people":83},{"views":29,"date":"2011-10-05","people":24},{"views":89,"date":"2011-10-04","people":45}],"now_in_zone":"2011-11-02T21:16:06-04:00"}}
@@ -0,0 +1,5 @@
1
+ HTTP/1.1 422 Unprocessable Entity
2
+ Content-Type: application/json
3
+ Connection: keep-alive
4
+
5
+ {"errors":{"tz":"is not included in the list"},"full_messages":["Tz is not included in the list"]}
@@ -0,0 +1,7 @@
1
+ HTTP/1.1 201 Created
2
+ Content-Type: application/json
3
+ X-Runtime: 0.129834
4
+ Set-Cookie: rack.session=BAh7AA%3D%3D%0A--ec3ba6a2c83f2dc155420e85f25335320848a463; path=/; expires=Tue, 23-Aug-2011 16:55:20 GMT
5
+ Connection: keep-alive
6
+
7
+ {"gauge":{"recent_months":[{"views":0,"date":"2011-11-01","people":0}],"today":{"views":0,"date":"2011-11-02","people":0},"title":"Example","urls":{"shares":"https://secure.gaug.es/gauges/4eb1eaf5e5947c7408000001/shares","referrers":"https://secure.gaug.es/gauges/4eb1eaf5e5947c7408000001/referrers","self":"https://secure.gaug.es/gauges/4eb1eaf5e5947c7408000001","technology":"https://secure.gaug.es/gauges/4eb1eaf5e5947c7408000001/technology","content":"https://secure.gaug.es/gauges/4eb1eaf5e5947c7408000001/content","locations":"https://secure.gaug.es/gauges/4eb1eaf5e5947c7408000001/locations","engines":"https://secure.gaug.es/gauges/4eb1eaf5e5947c7408000001/engines","terms":"https://secure.gaug.es/gauges/4eb1eaf5e5947c7408000001/terms","resolutions":"https://secure.gaug.es/gauges/4eb1eaf5e5947c7408000001/resolutions","traffic":"https://secure.gaug.es/gauges/4eb1eaf5e5947c7408000001/traffic"},"recent_hours":[{"hour":"21","views":0,"people":0},{"hour":"20","views":0,"people":0},{"hour":"19","views":0,"people":0},{"hour":"18","views":0,"people":0},{"hour":"17","views":0,"people":0},{"hour":"16","views":0,"people":0},{"hour":"15","views":0,"people":0},{"hour":"14","views":0,"people":0},{"hour":"13","views":0,"people":0},{"hour":"12","views":0,"people":0},{"hour":"11","views":0,"people":0},{"hour":"10","views":0,"people":0},{"hour":"09","views":0,"people":0},{"hour":"08","views":0,"people":0},{"hour":"07","views":0,"people":0},{"hour":"06","views":0,"people":0},{"hour":"05","views":0,"people":0},{"hour":"04","views":0,"people":0},{"hour":"03","views":0,"people":0},{"hour":"02","views":0,"people":0},{"hour":"01","views":0,"people":0},{"hour":"00","views":0,"people":0},{"hour":"23","views":0,"people":0},{"hour":"22","views":0,"people":0}],"yesterday":{"views":0,"date":"2011-11-01","people":0},"all_time":{"views":0,"people":0},"id":"4eb1eaf5e5947c7408000001","creator_id":"4df37acbe5947cabdd000001","enabled":true,"tz":"Eastern Time (US & Canada)","recent_days":[{"views":0,"date":"2011-11-02","people":0},{"views":0,"date":"2011-11-01","people":0},{"views":0,"date":"2011-10-31","people":0},{"views":0,"date":"2011-10-30","people":0},{"views":0,"date":"2011-10-29","people":0},{"views":0,"date":"2011-10-28","people":0},{"views":0,"date":"2011-10-27","people":0},{"views":0,"date":"2011-10-26","people":0},{"views":0,"date":"2011-10-25","people":0},{"views":0,"date":"2011-10-24","people":0},{"views":0,"date":"2011-10-23","people":0},{"views":0,"date":"2011-10-22","people":0},{"views":0,"date":"2011-10-21","people":0},{"views":0,"date":"2011-10-20","people":0},{"views":0,"date":"2011-10-19","people":0},{"views":0,"date":"2011-10-18","people":0},{"views":0,"date":"2011-10-17","people":0},{"views":0,"date":"2011-10-16","people":0},{"views":0,"date":"2011-10-15","people":0},{"views":0,"date":"2011-10-14","people":0},{"views":0,"date":"2011-10-13","people":0},{"views":0,"date":"2011-10-12","people":0},{"views":0,"date":"2011-10-11","people":0},{"views":0,"date":"2011-10-10","people":0},{"views":0,"date":"2011-10-09","people":0},{"views":0,"date":"2011-10-08","people":0},{"views":0,"date":"2011-10-07","people":0},{"views":0,"date":"2011-10-06","people":0},{"views":0,"date":"2011-10-05","people":0},{"views":0,"date":"2011-10-04","people":0}],"now_in_zone":"2011-11-02T21:14:29-04:00"}}
@@ -0,0 +1,5 @@
1
+ HTTP/1.1 200 OK
2
+ Content-Type: application/json
3
+ Connection: keep-alive
4
+
5
+ {"gauge":{"recent_months":[{"views":0,"date":"2011-11-01","people":0}],"today":{"views":0,"date":"2011-11-02","people":0},"title":"New Title","urls":{"shares":"https://secure.gaug.es/gauges/4eb1eaf5e5947c7408000001/shares","referrers":"https://secure.gaug.es/gauges/4eb1eaf5e5947c7408000001/referrers","self":"https://secure.gaug.es/gauges/4eb1eaf5e5947c7408000001","technology":"https://secure.gaug.es/gauges/4eb1eaf5e5947c7408000001/technology","content":"https://secure.gaug.es/gauges/4eb1eaf5e5947c7408000001/content","locations":"https://secure.gaug.es/gauges/4eb1eaf5e5947c7408000001/locations","engines":"https://secure.gaug.es/gauges/4eb1eaf5e5947c7408000001/engines","terms":"https://secure.gaug.es/gauges/4eb1eaf5e5947c7408000001/terms","resolutions":"https://secure.gaug.es/gauges/4eb1eaf5e5947c7408000001/resolutions","traffic":"https://secure.gaug.es/gauges/4eb1eaf5e5947c7408000001/traffic"},"recent_hours":[{"hour":"21","views":0,"people":0},{"hour":"20","views":0,"people":0},{"hour":"19","views":0,"people":0},{"hour":"18","views":0,"people":0},{"hour":"17","views":0,"people":0},{"hour":"16","views":0,"people":0},{"hour":"15","views":0,"people":0},{"hour":"14","views":0,"people":0},{"hour":"13","views":0,"people":0},{"hour":"12","views":0,"people":0},{"hour":"11","views":0,"people":0},{"hour":"10","views":0,"people":0},{"hour":"09","views":0,"people":0},{"hour":"08","views":0,"people":0},{"hour":"07","views":0,"people":0},{"hour":"06","views":0,"people":0},{"hour":"05","views":0,"people":0},{"hour":"04","views":0,"people":0},{"hour":"03","views":0,"people":0},{"hour":"02","views":0,"people":0},{"hour":"01","views":0,"people":0},{"hour":"00","views":0,"people":0},{"hour":"23","views":0,"people":0},{"hour":"22","views":0,"people":0}],"yesterday":{"views":0,"date":"2011-11-01","people":0},"all_time":{"views":0,"people":0},"id":"4eb1eaf5e5947c7408000001","creator_id":"4df37acbe5947cabdd000001","enabled":true,"tz":"Eastern Time (US & Canada)","recent_days":[{"views":0,"date":"2011-11-02","people":0},{"views":0,"date":"2011-11-01","people":0},{"views":0,"date":"2011-10-31","people":0},{"views":0,"date":"2011-10-30","people":0},{"views":0,"date":"2011-10-29","people":0},{"views":0,"date":"2011-10-28","people":0},{"views":0,"date":"2011-10-27","people":0},{"views":0,"date":"2011-10-26","people":0},{"views":0,"date":"2011-10-25","people":0},{"views":0,"date":"2011-10-24","people":0},{"views":0,"date":"2011-10-23","people":0},{"views":0,"date":"2011-10-22","people":0},{"views":0,"date":"2011-10-21","people":0},{"views":0,"date":"2011-10-20","people":0},{"views":0,"date":"2011-10-19","people":0},{"views":0,"date":"2011-10-18","people":0},{"views":0,"date":"2011-10-17","people":0},{"views":0,"date":"2011-10-16","people":0},{"views":0,"date":"2011-10-15","people":0},{"views":0,"date":"2011-10-14","people":0},{"views":0,"date":"2011-10-13","people":0},{"views":0,"date":"2011-10-12","people":0},{"views":0,"date":"2011-10-11","people":0},{"views":0,"date":"2011-10-10","people":0},{"views":0,"date":"2011-10-09","people":0},{"views":0,"date":"2011-10-08","people":0},{"views":0,"date":"2011-10-07","people":0},{"views":0,"date":"2011-10-06","people":0},{"views":0,"date":"2011-10-05","people":0},{"views":0,"date":"2011-10-04","people":0}],"now_in_zone":"2011-11-02T21:19:08-04:00"}}
@@ -0,0 +1,5 @@
1
+ HTTP/1.1 404 Not Found
2
+ Content-Type: application/json
3
+ Connection: close
4
+
5
+ {"status":"fail","message":"Not found"}
@@ -0,0 +1,5 @@
1
+ HTTP/1.1 200 OK
2
+ Content-Type: application/json
3
+ Connection: keep-alive
4
+
5
+ {"gauge":{"recent_months":[{"views":0,"date":"2011-11-01","people":0}],"today":{"views":0,"date":"2011-11-02","people":0},"title":"New Title","urls":{"shares":"https://secure.gaug.es/gauges/4eb1eaf5e5947c7408000001/shares","referrers":"https://secure.gaug.es/gauges/4eb1eaf5e5947c7408000001/referrers","self":"https://secure.gaug.es/gauges/4eb1eaf5e5947c7408000001","technology":"https://secure.gaug.es/gauges/4eb1eaf5e5947c7408000001/technology","content":"https://secure.gaug.es/gauges/4eb1eaf5e5947c7408000001/content","locations":"https://secure.gaug.es/gauges/4eb1eaf5e5947c7408000001/locations","engines":"https://secure.gaug.es/gauges/4eb1eaf5e5947c7408000001/engines","terms":"https://secure.gaug.es/gauges/4eb1eaf5e5947c7408000001/terms","resolutions":"https://secure.gaug.es/gauges/4eb1eaf5e5947c7408000001/resolutions","traffic":"https://secure.gaug.es/gauges/4eb1eaf5e5947c7408000001/traffic"},"recent_hours":[{"hour":"21","views":0,"people":0},{"hour":"20","views":0,"people":0},{"hour":"19","views":0,"people":0},{"hour":"18","views":0,"people":0},{"hour":"17","views":0,"people":0},{"hour":"16","views":0,"people":0},{"hour":"15","views":0,"people":0},{"hour":"14","views":0,"people":0},{"hour":"13","views":0,"people":0},{"hour":"12","views":0,"people":0},{"hour":"11","views":0,"people":0},{"hour":"10","views":0,"people":0},{"hour":"09","views":0,"people":0},{"hour":"08","views":0,"people":0},{"hour":"07","views":0,"people":0},{"hour":"06","views":0,"people":0},{"hour":"05","views":0,"people":0},{"hour":"04","views":0,"people":0},{"hour":"03","views":0,"people":0},{"hour":"02","views":0,"people":0},{"hour":"01","views":0,"people":0},{"hour":"00","views":0,"people":0},{"hour":"23","views":0,"people":0},{"hour":"22","views":0,"people":0}],"yesterday":{"views":0,"date":"2011-11-01","people":0},"all_time":{"views":0,"people":0},"id":"4eb1eaf5e5947c7408000001","creator_id":"4df37acbe5947cabdd000001","enabled":true,"tz":"Eastern Time (US & Canada)","recent_days":[{"views":0,"date":"2011-11-02","people":0},{"views":0,"date":"2011-11-01","people":0},{"views":0,"date":"2011-10-31","people":0},{"views":0,"date":"2011-10-30","people":0},{"views":0,"date":"2011-10-29","people":0},{"views":0,"date":"2011-10-28","people":0},{"views":0,"date":"2011-10-27","people":0},{"views":0,"date":"2011-10-26","people":0},{"views":0,"date":"2011-10-25","people":0},{"views":0,"date":"2011-10-24","people":0},{"views":0,"date":"2011-10-23","people":0},{"views":0,"date":"2011-10-22","people":0},{"views":0,"date":"2011-10-21","people":0},{"views":0,"date":"2011-10-20","people":0},{"views":0,"date":"2011-10-19","people":0},{"views":0,"date":"2011-10-18","people":0},{"views":0,"date":"2011-10-17","people":0},{"views":0,"date":"2011-10-16","people":0},{"views":0,"date":"2011-10-15","people":0},{"views":0,"date":"2011-10-14","people":0},{"views":0,"date":"2011-10-13","people":0},{"views":0,"date":"2011-10-12","people":0},{"views":0,"date":"2011-10-11","people":0},{"views":0,"date":"2011-10-10","people":0},{"views":0,"date":"2011-10-09","people":0},{"views":0,"date":"2011-10-08","people":0},{"views":0,"date":"2011-10-07","people":0},{"views":0,"date":"2011-10-06","people":0},{"views":0,"date":"2011-10-05","people":0},{"views":0,"date":"2011-10-04","people":0}],"now_in_zone":"2011-11-02T21:18:12-04:00"}}
@@ -0,0 +1,5 @@
1
+ HTTP/1.1 200 OK
2
+ Content-Type: application/json
3
+ Connection: close
4
+
5
+ {"gauges":[{"recent_months":[{"views":190,"date":"2011-11-01","people":82},{"views":2452,"date":"2011-10-01","people":1517},{"views":868,"date":"2011-09-01","people":488},{"views":562,"date":"2011-08-01","people":269},{"views":3287,"date":"2011-07-01","people":2640},{"views":224,"date":"2011-06-01","people":133},{"views":143,"date":"2011-05-01","people":105},{"views":86,"date":"2011-04-01","people":52},{"views":367,"date":"2011-03-01","people":144},{"views":80,"date":"2011-02-01","people":44}],"today":{"views":53,"date":"2011-11-02","people":29},"title":"acme.com","urls":{"shares":"https://secure.gaug.es/gauges/4d597dfd6bb4ba2c48000003/shares","referrers":"https://secure.gaug.es/gauges/4d597dfd6bb4ba2c48000003/referrers","self":"https://secure.gaug.es/gauges/4d597dfd6bb4ba2c48000003","technology":"https://secure.gaug.es/gauges/4d597dfd6bb4ba2c48000003/technology","content":"https://secure.gaug.es/gauges/4d597dfd6bb4ba2c48000003/content","locations":"https://secure.gaug.es/gauges/4d597dfd6bb4ba2c48000003/locations","engines":"https://secure.gaug.es/gauges/4d597dfd6bb4ba2c48000003/engines","terms":"https://secure.gaug.es/gauges/4d597dfd6bb4ba2c48000003/terms","resolutions":"https://secure.gaug.es/gauges/4d597dfd6bb4ba2c48000003/resolutions","traffic":"https://secure.gaug.es/gauges/4d597dfd6bb4ba2c48000003/traffic"},"recent_hours":[{"hour":"21","views":0,"people":0},{"hour":"20","views":0,"people":0},{"hour":"19","views":0,"people":0},{"hour":"18","views":0,"people":0},{"hour":"17","views":0,"people":0},{"hour":"16","views":0,"people":0},{"hour":"15","views":0,"people":0},{"hour":"14","views":0,"people":0},{"hour":"13","views":0,"people":0},{"hour":"12","views":0,"people":0},{"hour":"11","views":1,"people":1},{"hour":"10","views":8,"people":4},{"hour":"09","views":12,"people":9},{"hour":"08","views":9,"people":6},{"hour":"07","views":1,"people":0},{"hour":"06","views":4,"people":3},{"hour":"05","views":3,"people":0},{"hour":"04","views":0,"people":0},{"hour":"03","views":1,"people":1},{"hour":"02","views":7,"people":4},{"hour":"01","views":3,"people":3},{"hour":"00","views":4,"people":2},{"hour":"23","views":15,"people":6},{"hour":"22","views":7,"people":5}],"yesterday":{"views":137,"date":"2011-11-01","people":72},"all_time":{"views":8259,"people":5349},"id":"4d597dfd6bb4ba2c48000003","creator_id":"4df37acbe5947cabdd000001","enabled":true,"tz":"Eastern Time (US & Canada)","recent_days":[{"views":53,"date":"2011-11-02","people":29},{"views":137,"date":"2011-11-01","people":72},{"views":154,"date":"2011-10-31","people":108},{"views":70,"date":"2011-10-30","people":39},{"views":310,"date":"2011-10-29","people":186},{"views":360,"date":"2011-10-28","people":233},{"views":16,"date":"2011-10-27","people":11},{"views":17,"date":"2011-10-26","people":12},{"views":19,"date":"2011-10-25","people":13},{"views":10,"date":"2011-10-24","people":9},{"views":2,"date":"2011-10-23","people":2},{"views":6,"date":"2011-10-22","people":6},{"views":19,"date":"2011-10-21","people":11},{"views":65,"date":"2011-10-20","people":49},{"views":13,"date":"2011-10-19","people":11},{"views":8,"date":"2011-10-18","people":5},{"views":22,"date":"2011-10-17","people":18},{"views":24,"date":"2011-10-16","people":16},{"views":133,"date":"2011-10-15","people":113},{"views":366,"date":"2011-10-14","people":335},{"views":27,"date":"2011-10-13","people":19},{"views":19,"date":"2011-10-12","people":13},{"views":17,"date":"2011-10-11","people":9},{"views":80,"date":"2011-10-10","people":46},{"views":33,"date":"2011-10-09","people":8},{"views":20,"date":"2011-10-08","people":9},{"views":29,"date":"2011-10-07","people":16},{"views":143,"date":"2011-10-06","people":83},{"views":29,"date":"2011-10-05","people":24},{"views":89,"date":"2011-10-04","people":45}],"now_in_zone":"2011-11-02T21:11:53-04:00"},{"recent_months":[{"views":8935,"date":"2011-11-01","people":2630},{"views":198557,"date":"2011-10-01","people":63605},{"views":126081,"date":"2011-09-01","people":43493},{"views":5714,"date":"2011-08-01","people":2469},{"views":3219,"date":"2011-07-01","people":1514},{"views":4295,"date":"2011-06-01","people":1912},{"views":3623,"date":"2011-05-01","people":1864}],"today":{"views":4114,"date":"2011-11-02","people":1452},"title":"Widgets Inc","urls":{"shares":"https://secure.gaug.es/gauges/4dd2a2b5613f5d2021000005/shares","referrers":"https://secure.gaug.es/gauges/4dd2a2b5613f5d2021000005/referrers","self":"https://secure.gaug.es/gauges/4dd2a2b5613f5d2021000005","technology":"https://secure.gaug.es/gauges/4dd2a2b5613f5d2021000005/technology","content":"https://secure.gaug.es/gauges/4dd2a2b5613f5d2021000005/content","locations":"https://secure.gaug.es/gauges/4dd2a2b5613f5d2021000005/locations","engines":"https://secure.gaug.es/gauges/4dd2a2b5613f5d2021000005/engines","terms":"https://secure.gaug.es/gauges/4dd2a2b5613f5d2021000005/terms","resolutions":"https://secure.gaug.es/gauges/4dd2a2b5613f5d2021000005/resolutions","traffic":"https://secure.gaug.es/gauges/4dd2a2b5613f5d2021000005/traffic"},"recent_hours":[{"hour":"21","views":0,"people":0},{"hour":"20","views":0,"people":0},{"hour":"19","views":0,"people":0},{"hour":"18","views":0,"people":0},{"hour":"17","views":0,"people":0},{"hour":"16","views":0,"people":0},{"hour":"15","views":254,"people":107},{"hour":"14","views":293,"people":121},{"hour":"13","views":232,"people":105},{"hour":"12","views":265,"people":119},{"hour":"11","views":337,"people":111},{"hour":"10","views":414,"people":124},{"hour":"09","views":381,"people":152},{"hour":"08","views":282,"people":142},{"hour":"07","views":243,"people":107},{"hour":"06","views":247,"people":94},{"hour":"05","views":250,"people":117},{"hour":"04","views":212,"people":103},{"hour":"03","views":166,"people":77},{"hour":"02","views":147,"people":70},{"hour":"01","views":173,"people":68},{"hour":"00","views":218,"people":91},{"hour":"23","views":369,"people":102},{"hour":"22","views":217,"people":102}],"yesterday":{"views":4821,"date":"2011-11-01","people":1853},"all_time":{"views":350424,"people":115318},"id":"4dd2a2b5613f5d2021000005","creator_id":"4d597dea137ce429a7000007","enabled":true,"tz":"Eastern Time (US & Canada)","recent_days":[{"views":4114,"date":"2011-11-02","people":1452},{"views":4821,"date":"2011-11-01","people":1853},{"views":5648,"date":"2011-10-31","people":2549},{"views":7355,"date":"2011-10-30","people":3879},{"views":8010,"date":"2011-10-29","people":4574},{"views":3732,"date":"2011-10-28","people":1304},{"views":4492,"date":"2011-10-27","people":1629},{"views":4692,"date":"2011-10-26","people":1668},{"views":5989,"date":"2011-10-25","people":2150},{"views":6251,"date":"2011-10-24","people":2231},{"views":4122,"date":"2011-10-23","people":1579},{"views":4191,"date":"2011-10-22","people":1612},{"views":6348,"date":"2011-10-21","people":2865},{"views":5704,"date":"2011-10-20","people":1995},{"views":6525,"date":"2011-10-19","people":2088},{"views":8276,"date":"2011-10-18","people":3082},{"views":11094,"date":"2011-10-17","people":5135},{"views":14104,"date":"2011-10-16","people":7996},{"views":3145,"date":"2011-10-15","people":1201},{"views":5530,"date":"2011-10-14","people":2087},{"views":8053,"date":"2011-10-13","people":3595},{"views":6518,"date":"2011-10-12","people":2526},{"views":9137,"date":"2011-10-11","people":3597},{"views":7091,"date":"2011-10-10","people":2531},{"views":3612,"date":"2011-10-09","people":1234},{"views":4240,"date":"2011-10-08","people":1594},{"views":7376,"date":"2011-10-07","people":2557},{"views":5521,"date":"2011-10-06","people":1885},{"views":5968,"date":"2011-10-05","people":2106},{"views":8546,"date":"2011-10-04","people":3415}],"now_in_zone":"2011-11-02T21:11:53-04:00"}]}
@@ -0,0 +1,5 @@
1
+ HTTP/1.1 200 OK
2
+ Content-Type: application/json
3
+ Connection: keep-alive
4
+
5
+ {"urls":{"older":"https://secure.gaug.es/gauges/4d597dfd6bb4ba2c48000003/locations?date=2011-10-01","newer":null},"date":"2011-11-02","locations":[{"regions":[{"title":"California","views":22,"key":"CA"},{"title":"Illinois","views":8,"key":"IL"},{"title":"Michigan","views":8,"key":"MI"},{"title":"Florida","views":8,"key":"FL"},{"title":"Missouri","views":6,"key":"MO"},{"title":"Connecticut","views":5,"key":"CT"},{"title":"Indiana","views":5,"key":"IN"},{"title":"New York","views":4,"key":"NY"},{"title":"Pennsylvania","views":4,"key":"PA"},{"title":"Texas","views":2,"key":"TX"},{"title":"Washington","views":2,"key":"WA"},{"title":"Colorado","views":2,"key":"CO"},{"title":"Alaska","views":2,"key":"AK"},{"title":"Arizona","views":1,"key":"AZ"},{"title":"Ohio","views":1,"key":"OH"},{"title":"Oregon","views":1,"key":"OR"},{"title":"Iowa","views":1,"key":"IA"},{"title":"Massachusetts","views":1,"key":"MA"},{"title":"Minnesota","views":1,"key":"MN"},{"title":"Georgia","views":1,"key":"GA"}],"title":"United States","views":85,"key":"US"},{"regions":[{"title":"Ontario","views":13,"key":"ON"},{"title":"British Columbia","views":4,"key":"BC"},{"title":"Qu\u00e9bec","views":1,"key":"QC"}],"title":"Canada","views":18,"key":"CA"},{"regions":[],"title":"United Kingdom","views":15,"key":"GB"},{"regions":[],"title":"Australia","views":9,"key":"AU"},{"regions":[],"title":"Finland","views":7,"key":"FI"},{"regions":[],"title":"Netherlands","views":6,"key":"NL"},{"regions":[],"title":"Sweden","views":6,"key":"SE"},{"regions":[],"title":"Romania","views":4,"key":"RO"},{"regions":[],"title":"Germany","views":3,"key":"DE"},{"regions":[],"title":"India","views":3,"key":"IN"},{"regions":[],"title":"France","views":3,"key":"FR"},{"regions":[],"title":"Brazil","views":2,"key":"BR"},{"regions":[],"title":"Turkey","views":2,"key":"TR"},{"regions":[],"title":"Hungary","views":2,"key":"HU"},{"regions":[],"title":"Poland","views":2,"key":"PL"},{"regions":[],"title":"Anonymous Proxy","views":2,"key":"A1"},{"regions":[],"title":"Belgium","views":1,"key":"BE"},{"regions":[],"title":"Norway","views":1,"key":"NO"},{"regions":[],"title":"Russian Federation","views":1,"key":"RU"},{"regions":[],"title":"Czech Republic","views":1,"key":"CZ"},{"regions":[],"title":"Greece","views":1,"key":"GR"},{"regions":[],"title":"Luxembourg","views":1,"key":"LU"},{"regions":[],"title":"Mexico","views":1,"key":"MX"}]}
@@ -0,0 +1,5 @@
1
+ HTTP/1.1 200 OK
2
+ Content-Type: application/json
3
+ Connection: close
4
+
5
+ {"user":{"name":"john@doe.com","urls":{"self":"https://secure.gaug.es/me","gauges":"https://secure.gaug.es/gauges","clients":"https://secure.gaug.es/clients"},"id":"4df37acbe5947cabdd000001","last_name":null,"email":"john@doe.com","first_name":null}}
@@ -0,0 +1,5 @@
1
+ HTTP/1.1 200 OK
2
+ Content-Type: application/json
3
+ Connection: keep-alive
4
+
5
+ {"user":{"name":"john@doe.com","urls":{"self":"https://secure.gaug.es/me","gauges":"https://secure.gaug.es/gauges","clients":"https://secure.gaug.es/clients"},"id":"4df37acbe5947cabdd000001","last_name":null,"email":"john@doe.com","first_name":Joe}}
@@ -0,0 +1,5 @@
1
+ HTTP/1.1 200 OK
2
+ Content-Type: application/json
3
+ Connection: keep-alive
4
+
5
+ {"referrers":[{"url":"http://martinciu.com/2011/11/deploying-hubot-to-heroku-like-a-boss.html","views":1,"path":"/2011/11/deploying-hubot-to-heroku-like-a-boss.html","host":"martinciu.com"},{"url":"http://www.reddit.com/r/programming/comments/lsluj/hubot_hipchat_and_heroku/","views":1,"path":"/r/programming/comments/lsluj/hubot_hipchat_and_heroku/","host":"reddit.com"}],"urls":{"older":"https://secure.gaug.es/gauges/4d597dfd6bb4ba2c48000003/referrers?date=2011-11-01","previous_page":null,"next_page":null,"newer":null},"date":"2011-11-02","page":1,"per_page":50}
@@ -0,0 +1,5 @@
1
+ HTTP/1.1 200 OK
2
+ Content-Type: application/json
3
+ Connection: keep-alive
4
+
5
+ {"urls":{"older":"https://secure.gaug.es/gauges/4d597dfd6bb4ba2c48000003/resolutions?date=2011-10-01","newer":null},"browser_heights":[{"title":"600","views":69},{"title":"768","views":49},{"title":"1024","views":30},{"title":"900","views":26},{"title":"480","views":14}],"screen_widths":[{"title":"1600","views":58},{"title":"1440","views":55},{"title":"1280","views":29},{"title":"2000","views":27},{"title":"320","views":9},{"title":"480","views":4},{"title":"1024","views":4},{"title":"800","views":2}],"date":"2011-11-02","browser_widths":[{"title":"1280","views":56},{"title":"1024","views":55},{"title":"1440","views":29},{"title":"1600","views":28},{"title":"800","views":8},{"title":"320","views":8},{"title":"480","views":4},{"title":"2000","views":0}]}
@@ -0,0 +1,5 @@
1
+ HTTP/1.1 422 Unprocessable Entity
2
+ Content-Type: application/json
3
+ Connection: keep-alive
4
+
5
+ {"errors":{"email":"does not appear to be legit"},"full_messages":["Email does not appear to be legit"]}
@@ -0,0 +1,5 @@
1
+ HTTP/1.1 200 Created
2
+ Content-Type: application/json
3
+ Connection: close
4
+
5
+ {"share":{"name":"jane@doe.com","urls":{"remove":"https://secure.gaug.es/gauges/4d597dfd6bb4ba2c48000003/shares/4eb1ed03e5947c7408000002"},"id":"4eb1ed03e5947c7408000002","type":"invite","last_name":null,"email":"jane@doe.com","first_name":null}}
@@ -0,0 +1,5 @@
1
+ HTTP/1.1 200 OK
2
+ Content-Type: application/json
3
+ Connection: keep-alive
4
+
5
+ {"share":{"name":"jane@doe.com","urls":{"remove":"https://secure.gaug.es/gauges/4d597dfd6bb4ba2c48000003/shares/4eb1ed03e5947c7408000002"},"id":"4eb1ed03e5947c7408000002","type":"invite","last_name":null,"email":"jane@doe.com","first_name":null}}