WiserEarth API Developers

Your source for documentation and support

The WiserEarth API is the ultimate resource for building web applications that help "Connect You to Communities of Action". It is a language and message format used by a remote application program to communicate with the WiserEarth control program to access or write information into our database. This group is a place for developers to share information, fin ...learn more

GROUP DETAILS

Created: Dec 10, 2008

Updated: Nov 25, 2009

Membership: Open

Semi-Private

Created: Aug 07, 2009
Updated: Aug 13, 2009
Viewed: 198 times

Topic: api docs ruby example

Posts (1 - 6 of 6)

Sort by: Ascending | Descending
Login to Post a Reply.
Sm_avatar
hi everybody,

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


Sm_avatar
Thanks Christophe for the example. We'll add it to the documentation. Best, Angus


Sm_avatar
angusparker 4 months ago
This comment was removed by a WiserEarth editor for the following reason:
Duplicate
Sm_avatar
angusparker 4 months ago
This comment was removed by a WiserEarth editor for the following reason:
Duplicate
Sm_avatar
Great, thanks!  I'm working with Oz to clean up the documentation, so I'll make sure this updated ruby example is included. 
Sm_avatar

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


Contributors to this Page