Skip to content

Commit

Permalink
Get authed user's member ID on LinkedIn (#56)
Browse files Browse the repository at this point in the history
This isn't secret information, but it's hard (impossible?) to get without the API. So get it as part of the flow.
  • Loading branch information
jonthegeek authored Oct 21, 2024
1 parent fd2c5fe commit fb57d64
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion runner-li.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ alt_text <- paste(
"a black paint splash"
)

author <- "urn:li:person:mBbHaQfQtg"
author_req <- li_base |>
httr2::req_url("https://api.linkedin.com/v2/me")
author_id <- li_perform(author_req) |> httr2::resp_body_json() |> _$id

author <- glue::glue("urn:li:person:{author_id}")

# The new LinkedIn API uses markdown, so escape _ so it isn't confused.
status_msg <- stringr::str_replace_all(
Expand Down

0 comments on commit fb57d64

Please sign in to comment.