Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Arisamiga/Linkedin-RSS
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.2.1
Choose a base ref
...
head repository: Arisamiga/Linkedin-RSS
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1.2.2
Choose a head ref
  • 6 commits
  • 4 files changed
  • 1 contributor

Commits on Dec 11, 2023

  1. Updated to use Linkedin's userinfo

    Arisamiga committed Dec 11, 2023
    Copy the full SHA
    f6e9cd6 View commit details
  2. New Information based on LinkedIn's Product changes

    Arisamiga authored Dec 11, 2023
    Copy the full SHA
    495f689 View commit details
  3. Copy the full SHA
    373ca5d View commit details
  4. Merge branch 'master' of https://github.com/Arisamiga/Linkedin-RSS

    Arisamiga committed Dec 11, 2023
    Copy the full SHA
    94fd385 View commit details

Commits on Dec 12, 2023

  1. Build Release script

    Arisamiga committed Dec 12, 2023
    Copy the full SHA
    88ded33 View commit details
  2. Expected mapping

    Arisamiga committed Dec 12, 2023
    Copy the full SHA
    a06e097 View commit details
Showing with 29 additions and 7 deletions.
  1. +2 −2 README.md
  2. +13 −2 dist/index.js
  3. +1 −1 dist/index.js.map
  4. +13 −2 index.js
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -52,12 +52,12 @@ Register the app in [LinkedIn Developer Network](https://developer.linkedin.com/
#

- Once you made your Application go to your App and go to "Products"
- From there Select "Share on LinkedIn" and "Sign In with LinkedIn" and "Request Access" For both of them
- From there Select "Share on LinkedIn" and "Sign In with LinkedIn using OpenID Connect" and "Request Access" For both of them

#

- Once you have added your Products go to https://www.linkedin.com/developers/tools/oauth/
- Select "Create a new access token" and click "Create Token" Select your app and make sure you have the `r_liteprofile`, `w_member_social` scopes selected.
- Select "Create a new access token" and click "Create Token" Select your app and make sure you have the `openid`, `profile` and `w_member_social` scopes selected.
- Press "Request Access Token" and you will be asked to login. After Successfully logging in you will be given your Access Token.

# Notices
15 changes: 13 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

15 changes: 13 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ const embedImage = core.getInput("embed_image");
function getLinkedinId(accessToken) {
return new Promise((resolve, reject) => {
const hostname = "api.linkedin.com";
const path = "/v2/me";
const path = "/v2/userinfo";
const method = "GET";
const headers = {
Authorization: "Bearer " + accessToken,
@@ -23,7 +23,18 @@ function getLinkedinId(accessToken) {
const body = "";
_request(method, hostname, path, headers, body)
.then((r) => {
resolve(JSON.parse(r.body).id);
// Check if sub has anything or else call /v2/me
if (JSON.parse(r.body).sub) return resolve(JSON.parse(r.body).sub);
// If sub is empty, call /v2/me
const hostname = "api.linkedin.com";
const path = "/v2/me";
const method = "GET";

_request(method, hostname, path, headers, body)
.then((r) => {
resolve(JSON.parse(r.body).id);
})
.catch((e) => reject(e));
})
.catch((e) => reject(e));
});