From 95b6be116b431d7a4d107b8eadbfec2f9893abb4 Mon Sep 17 00:00:00 2001 From: stve Date: Tue, 8 Sep 2015 21:36:47 -0400 Subject: [PATCH] added full auth flow example --- examples/authorization_flow.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 examples/authorization_flow.rb diff --git a/examples/authorization_flow.rb b/examples/authorization_flow.rb new file mode 100644 index 0000000..f26c8c2 --- /dev/null +++ b/examples/authorization_flow.rb @@ -0,0 +1,16 @@ +require 'instapaper' + +credentials = { + consumer_key: 'CONSUMER_KEY', + consumer_secret: 'CONSUMER_SECRET', +} + +client = Instapaper::Client.new(credentials) +token = client.access_token('username', 'password') +# => # + +client.oauth_token = token.oauth_token +client.oauth_token_secret = token.oauth_token_secret + +client.verify_credentials +# => #