Sha256: dde4c5673c44644720ff06c5848e7e6e7a76a829ec75b6eafea468d28df3970c

Contents?: true

Size: 705 Bytes

Versions: 1

Compression:

Stored size: 705 Bytes

Contents

require 'omniauth-xauth'

module OmniAuth
  module Strategies
    class Instapaper < OmniAuth::Strategies::XAuth
      option :client_options, {
        :site               => 'http://www.instapaper.com/',
        :access_token_url   => 'https://www.instapaper.com/api/1/oauth/access_token'
      }
      option :xauth_options, { :title => 'OmniAuth Instapaper'}

      uid { raw_info['user_id'] }

      info do
        { 'name' => raw_info['username'] }
      end

      extra do
        {'raw_info' => raw_info }
      end

      def raw_info
        @raw_info ||= MultiJson.decode(access_token.get("https://www.instapaper.com/api/1/account/verify_credentials").body).first
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
omniauth-instapaper-0.1.0 lib/omniauth/strategies/instapaper.rb