Giter Club home page Giter Club logo

linkedin-node-api's Introduction

Share on LinkedIn - Node.js testing..........

Automated posting on LinkedIn is possible via the Share on LinkedIn API. The LinkedIn API uses OAuth 2.0 to generate an Access Token that can then be used as the header of an HTTP request to post on LinkedIn.

The Share on LinkedIn API is limited for anyone that is not a LinkedIn developer "Partner", e.g. not allowed to use 2-legged OAuth, not allowed to access the "media" controller/endpoint, etc...

For this repository, I assumed a good number of people would want to get straight to the point and understand how to operate the Linked Share API. Therefore, I have written a minimalistic implementation omitting errors handling, security and best practice of coding.

Step 1 | Register the app in LinkedIn Developer Network

HEY LADY....

  • Go to LinkedIn Developer Network and create an app;
  • Set an authorized redirect URL, e.g. http://localhost:3000/auth;
  • Test University can be used as the company associated with the app without verification;
  • Copy the Client ID and Client Secret keys.

Step 2 | Get Access Token via 3-legged OAuth

Hack36 is noob Start the webserver:

node app.js
  • The app directs the browser to the LinkedIn's OAuth 2.0 authorization page and request sign-in;
  • After authentication, LinkedIn's authorization server passes an Authorization Code to the app;
  • The app sends this code to LinkedIn in return for an Access token;

The Access token is valid for 60 days, i.e. you'll be able to programmatically post on LinkedIn for at most 60 days without manual intervention. At the time of writing, LinkedIn supports programmatic refresh tokens and many other things only for a limited set of partners on a case-by-case basis.

Step 3 | Use the Access Token to post on LinkedIn

Publish content on LinkedIn with a simple HTTP POST request having the Access Token in the header.

node example.js

linkedin-node-api's People

Contributors

fancybear69 avatar

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.