Name: edanrb
Owner: Smithsonian Institution
Description: ruby connector for EDAN API
Created: 2013-11-14 19:53:38.0
Updated: 2016-07-13 20:36:23.0
Pushed: 2013-11-16 14:20:19.0
Homepage: null
Size: 128
Language: Ruby
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This is for an initial exploration of a Smithsonian API.
Use of this library requires a name & password and is currently for developers who are registered volunteers.
Contact Info: Sarah Allen allensa@si.edu
install edanrb
rt EDANUSER=SECRETNAME
rt EDANPASS=SECRETPASS
install json
quire 'edan'
= EDANQuery.new('myapp')
s = eq.request('q=art&wt=json')
s.code
"200"
quire 'json'
ON.parse(res.body)
{"responseHeader" ...
'edanrb'
Then, run the 'bundle install' command.
There are two ways to do this, you can create a file in your /config/initializer directory:
ig/initializer/edanrb_settings.rb:
ecify the username and password for the EDAN API:
'EDANUSER'] = "this_is_my_username"
'EDANPASS'] = "this_is_my_password"
Alternatively, you can do this from the command line when you start your rails server if you do not want to commit auth info for security reasons.
ANUSER="this_is_my_username" EDANPASS="this_is_my_password" rails server
Don't forget to add the 'require' statement to your controllers or other locations where you'll be calling edanrb methods:
ire 'edan'
hello_edan_world
q = EDANQuery.new('myapp')
es = eq.request('q=art&wt=json')
son_res = JSON.parse(res.body)