stilist / laminar

Turning digital dust into a digital sand painting
http://ratafia.info
4 stars 0 forks source link

Kiva support #26

Closed stilist closed 10 years ago

stilist commented 11 years ago

http://build.kiva.org/api

stilist commented 11 years ago

The API is completely broken. OAuth simply doesn’t work (The requested address <strong>'/oauth/authorize.txt'</strong> was not found on this server.), the app creator/editor is extremely buggy, and the documentation is nearly useless.

The farthest I’ve gotten is:

consumer = OAuth::Consumer.new(ENV["KIVA_APP_KEY"], ENV["KIVA_APP_SECRET"], {
    site: "https://api.kivaws.org"
})
request_token = consumer.get_request_token
puts request_token.authorize_url

Will revisit when they get things together.

stilist commented 11 years ago

Based on https://raw.github.com/kiva/omniauth-kiva/master/lib/omniauth/strategies/kiva.rb I’ve advanced to:

@client ||= OAuth::Consumer.new(ENV["KIVA_API_KEY"], ENV["KIVA_API_SECRET"], {
    site: "https://api.kivaws.org",
    authorize_url: "https://www.kiva.org/oauth/authorize",
    request_token_path: "/oauth/request_token",
    access_token_path: "/oauth/access_token"
})

Now I get an ‘invalid request’ error, which I think may be due to not giving a callback?

stilist commented 10 years ago

Finally figured this out.