GithubHelp home page GithubHelp logo

linkedin2's Introduction

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

linkedin2's People

Contributors

bobbrez avatar joshjordan avatar maxkohl88 avatar sitch avatar

Watchers

 avatar  avatar

Forkers

evertrue

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.