Last active
December 17, 2015 10:18
-
-
Save andreareginato/5593335 to your computer and use it in GitHub Desktop.
ruby -I lib/ .test.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # * * * * * * * * * * * * * * * * * * # | |
| # Example file to live test the API # | |
| # # | |
| # > ruby -I lib/ .test.rb # | |
| # # | |
| # * * * * * * * * * * * * * * * * * * # | |
| # | |
| # Set a valid access token | |
| # | |
| access_token = '9056d24aa19424de7e8e9440aabfe3acd824b1bcb46778ace3b21279bb7dff5f'; | |
| # | |
| # General config | |
| # | |
| require './lib/lelylan' | |
| require 'oauth2' | |
| client = OAuth2::Client.new( | |
| 'e0ce688bfa4e930c047152ba9407152c42a4808e3687e1cc254cafef705bc799', | |
| '9398aa2c90c624c72ae90d32245f69f0361cac3e80c3ca56e5285a34c8df403b', | |
| site: 'http://people.lelylan.com' | |
| ) | |
| access = { | |
| access_token: access_token, | |
| refresh_token: 'refresh_token', | |
| token_type: 'bearer', | |
| expires_in: nil | |
| }; | |
| token = OAuth2::AccessToken.new(client, access) | |
| # | |
| # Request with OAuth2 access token | |
| # | |
| #lelylan = Lelylan::Client.new(token: token) | |
| #response = lelylan.categories | |
| #puts response | |
| # | |
| # Request without authorization | |
| # | |
| #lelylan = Lelylan::Client.new | |
| #uri = 'http://requestb.in/1kkw2h91' | |
| #secret = 'secret-buba' | |
| #params = { properties: [{ id: 'status', value: 'on' }] } | |
| #response = lelylan.physical_properties(uri, secret, params) | |
| #puts response |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment