Skip to content

Commit

Permalink
Send X-Api-Token header with every request
Browse files Browse the repository at this point in the history
This will increase the request limit to 5000 per hour
  • Loading branch information
monfresh committed Aug 2, 2013
1 parent a7ae5ea commit 7a3b13a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ gem 'haml-rails'
# server
gem "unicorn", ">= 4.3.1"
gem 'newrelic_rpm'
gem 'ohanakapa', :git => "https://github.com/codeforamerica/ohanakapa-ruby.git", :branch => 'master' #for API wrapper
gem 'ohanakapa', :git => "git://github.com/codeforamerica/ohanakapa-ruby.git", :branch => 'master' #for API wrapper

# app config and ENV variables for heroku
gem "figaro", ">= 0.6.3"
Expand Down
22 changes: 11 additions & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
GIT
remote: git://github.com/jwhitley/requirejs-rails.git
revision: f2330104aeca4d193fd5680a22ae7eee85d814b5
specs:
requirejs-rails (0.9.1)
railties (>= 3.1.1, < 4.1)

GIT
remote: https://github.com/codeforamerica/ohanakapa-ruby.git
revision: 98f64635b85801d4bdacfba6117610d1155605d1
remote: git://github.com/codeforamerica/ohanakapa-ruby.git
revision: 372f6c21c8600295c2836153a709d051ce184e91
branch: master
specs:
ohanakapa (0.0.1)
Expand All @@ -16,6 +9,13 @@ GIT
hashie (~> 2.0)
multi_json (~> 1.3)

GIT
remote: git://github.com/jwhitley/requirejs-rails.git
revision: f2330104aeca4d193fd5680a22ae7eee85d814b5
specs:
requirejs-rails (0.9.1)
railties (>= 3.1.1, < 4.1)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -96,8 +96,8 @@ GEM
eventmachine (1.0.3)
execjs (1.4.0)
multi_json (~> 1.0)
faraday (0.8.7)
multipart-post (~> 1.1)
faraday (0.8.8)
multipart-post (~> 1.2.0)
faraday_middleware (0.9.0)
faraday (>= 0.7.4, < 0.9)
fattr (2.2.1)
Expand Down
4 changes: 2 additions & 2 deletions app/models/organization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ class Organization
# @param id [String] Organization ID.
# @return [Hashie::Mash] Hash representing a organization's details.
def self.get(id)
@client = Ohanakapa.new
@client = Ohanakapa.new(:api_token => ENV["OHANA_API_TOKEN"])
response = @client.organization(id)
end

# Performs a query of the API
# @param params [Object] parameter object.
# @return [Hashie::Mash] Hash representing a organization's details.
def self.query(params = {})
@client = Ohanakapa.new
@client = Ohanakapa.new(:api_token => ENV["OHANA_API_TOKEN"])

# return all results if keyword and location are blank
if params[:keyword].blank? && params[:location].blank?
Expand Down

0 comments on commit 7a3b13a

Please sign in to comment.