Project

linkedin2

0.01
No commit activity in last 3 years
No release in over 3 years
Ruby wrapper for the LinkedIn API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.6
~> 0.7.1
~> 0.11.1
~> 0.10.0
~> 1.3.3
~> 10.0
~> 3.0.0
~> 0.9.0
~> 2.5
~> 1.18.0
>= 0

Runtime

 Project Readme

LinkedIn 2

Build Status Coverage Status Code Climate A modernized LinkedIn Ruby client.

Installation

Add this line to your application's Gemfile:

gem 'linkedin2'

And then execute:

$ bundle

Or install it yourself as:

$ gem install linkedin2

Usage

Client Configuration

Configure an instance directly with a hash:

client = LinkedIn::Client.new key: <your-key>, secret: <your-secret>,
redirect_uri: <your-callback>, scope: %i(r_basicprofile r_network)

Or configure an instance directly with the configure method:

client = LinkedIn::Client.new
client.configure do |config|
  config.key = <your-key>
end
client.key # => <your-key>

Or configure the gem with a hash:

LinkedIn::Client.configure  key: <your-key>, secret: <your-secret>, redirect_uri: <your-callback>
client = LinkedIn::Client.new
client.key # => <your-key>

Or configure the gem with a block:

LinkedIn::Client.configure do |config|
  config.key = '<your-key>'
end
client = LinkedIn::Client.new
client.key # => <your-key>

Authentication

Following the LinkedIn Authentication Documentation:

Step 1. Register your application

Create a LinkedIn Account and register an application

Step 2a. Generate Authorization Code by redirecting user to LinkedIn's authorization dialog

# create a client and configure it with your :key, :secret and :redirect_uri. See "Client Configuration" above.
client.authorize_url # => A URI that will take a user to LinkedIn, ask them to login and redirect to the URI that you configured

Step 2b. Request Access Token by exchanging the authorization_code for it

# create a client and configure it with your :key, :secret and :redirect_uri. See "Client Configuration" above.
client.request_access_token '<token-from-response>'

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request