Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
github.com/johnaoss/linkedin-api
This package is for the V1 API which has been deprecated and is pending removal. I don't currently have any plans on supporting V2, although that may change in the future. Any V2 support would be a major breaking change, and as such the state of the API would be subject to massive change, as well as dropping V1 support.
This project functions as a pure Go interface for Linkedin's v1 REST API. Currently, this provides a lightweight, documented interface to get a user's posts & profile data into a native marshallable Go struct. Requests are made secure by using OAuth2.0 authenticated requests to LinkedIn's servers.
This was my first project written in Go, and so I'd love to hear your thoughts!
This currently only supports GET requests.
go get -t github.com/johnaoss/linkedin-api
That's it!
I haven't tested this with other routing packages, but this does indeed work for any program using gorilla/mux for routing purposes.
import api "github.com/johnaoss/linkedin-api"
func main() {
permissions := []string{"r_basicprofile"}
clientID := "myID"
clientSecret := "hush"
redirectURL := "https://example.com/totallyvalidauth"
api.InitConfig(permissions, clientID, clientSecret, redirectURL)
}
import api "github.com/johnaoss/linkedin-api"
func loginHandler(w http.ResponseWriter, r *http.Request) {
login := api.GetLoginURL(w,r)
html := "Your login is <a href=\"" + login + "\">Login here!</a>"
w.Write([]byte(html))
}
import api "github.com/johnaoss/linkedin-api"
// this handles the authorized redirect URL as specified in the Linkedin developer console
func authHandler(w http.ResponseWriter, r *http.Request) {
userData := api.GetProfileData(w,r)
html := "Your name is is " userData.FirstName + " " + userData.LastName
w.Write([]byte(html))
}
import api "github.com/johnaoss/linkedin-api"
func sharePost(w http.ResponseWriter, r *http.Request) {
vis := VisibilityStruct{Code: "anyone"}
post := &api.Post{Visibility: vis, Comment: "This is a comment"}
resp, err := api.SharePost(post,w,r)
if err != nil {
w.Write([]byte("Something went wrong!"))
} else {
w.Write([]byte("Your post was successfully shared!"))
}
}
This currently services only the non-partnered content as LinkedIn does not have any means of open-source developers to reliably acquire this data. Aside from that, if there are any bugs please feel free to get in touch with either an issue or an e-mail!
MIT Licensed, check the LICENSE.md file for more details.
current-share
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.