Skip to content

Commit

Permalink
working example to display series
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew J Cronk committed Feb 29, 2012
1 parent a7161f7 commit ae23384
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .env
@@ -0,0 +1,5 @@
TEMPODB_API_KEY=myagley
TEMPODB_API_SECRET=opensesame
TEMPODB_API_HOST=api.tempo-db.com
TEMPODB_API_PORT=443
TEMPODB_API_SECURE=True
1 change: 1 addition & 0 deletions Gemfile
@@ -1,3 +1,4 @@
source :rubygems
gem 'sinatra', '1.1.0'
gem 'thin', '1.2.7'
gem 'tempodb'
4 changes: 4 additions & 0 deletions Gemfile.lock
Expand Up @@ -3,10 +3,13 @@ GEM
specs:
daemons (1.1.8)
eventmachine (0.12.10)
json (1.6.5)
rack (1.4.1)
sinatra (1.1.0)
rack (~> 1.1)
tilt (~> 1.1)
tempodb (0.1.0)
json
thin (1.2.7)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
Expand All @@ -18,4 +21,5 @@ PLATFORMS

DEPENDENCIES
sinatra (= 1.1.0)
tempodb
thin (= 1.2.7)
12 changes: 11 additions & 1 deletion web.rb
@@ -1,5 +1,15 @@
require 'sinatra'
require 'tempodb'

get '/' do
"Hello, world"
api_key = ENV['TEMPODB_API_KEY']
api_secret = ENV['TEMPODB_API_SECRET']
api_host = ENV['TEMPODB_API_HOST']
api_port = Integer(ENV['TEMPODB_API_PORT'])
api_secure = ENV['TEMPODB_API_SECURE'] == "False" ? false : true

client = TempoDB::Client.new( api_key, api_secret, api_host, api_port, api_secure )
out = ""
client.get_series().each{ |series| out += series.to_json + "<br/>" }
out
end

0 comments on commit ae23384

Please sign in to comment.