Topic: api docs ruby example
Posts (1 - 6 of 6)
Sort by: Ascending | Descending
Login to Post a Reply.
|
Thanks Christophe for the example. We'll add it to the documentation. Best, Angus
|
|
This comment was removed by a WiserEarth editor for the following reason:
Duplicate |
|
This comment was removed by a WiserEarth editor for the following reason:
Duplicate |
|
Great, thanks! I'm working with Oz to clean up the documentation, so I'll make sure this updated ruby example is included.
|
|
no worries :) please let me know if you need any more feedback or help with anything ruby.
_c |
You do not have access to post to this record
1 to 6 of 6 Posts



not sure where to post feedback on the api docs, seems here?
the following is more idiomatic ruby than the example in the docs.
it's tested and works. also included are the requires for convenience.
require 'digest/md5'
require 'open-uri'
api_key = '670694205349ed6735de86557081cc0b'
secret = '85ebb64263b2ea4acc96b40853414e65'
solution_masterid = '800f18f66ac105ba42b83b781e7bfba5'
sig = Digest::MD5.hexdigest("masterid#{solution_masterid + secret}")
base_url = 'http://www.wiserearth.org/solutions/'
solution_url = "#{base_url}#{solution_masterid}?sig=#{sig}&key=#{api_key}"
solution_xml = open(solution_url).read
cheers,
_c