Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

Repository files navigation

LinkedIn 2

Build StatusCoverage StatusCode 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.newkey: <your-key>,secret: <your-secret>,redirect_uri: <your-callback>,scope: %i(r_basicprofiler_network)

Or configure an instance directly with the configure method:

client=LinkedIn::Client.newclient.configuredo |config|
config.key= <your-key>
endclient.key# => <your-key>

Or configure the gem with a hash:

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

Or configure the gem with a block:

LinkedIn::Client.configuredo |config|
config.key='<your-key>'endclient=LinkedIn::Client.newclient.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

About

A modernized LinkedIn Ruby client

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages