Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
github.com/dylanratcliffe/golinkedin
At the beginning, this library is created because of my previous job which involve scraping social media platforms, the intended purpose of this library is to get the Linkedin data as much as possible but still follow the raw structure that Linkedin has, which is to be frank, a ball of tangled mess of JSON. Now that a lot of people starting to use this library too I think it is time for me to be a bit more serious to maintain this. So with that in mind, I announce that there will be V2 of this library, which will introduce much simpler data structure and will be much more easy to use, and of course, much more clearer documentation. If anybody wants to help me, feel free to do so. Thanks!
- Franklin
Golinkedin is a library for scraping Linkedin. Unfortunately, auto login is impossible (probably...), so you need to retrieve Linkedin session cookies manually. As mentioned above, the purpose of this package is only for scraping, so there is no method for create, update, or delete data. Not all object is documented or present because the original author does not fully understand the purpose of some object returned by Linkedin internal API, and because the nature of Linkedin internal API that treat almost every object as optional, empty field or object will not be returned by Linkedin internal API, so some object or fields might be missing. Feel free to fork and contribute!
This package require go version 1.14 or above. Make sure you have go modules activated.
$ GO111MODULE=on go get github.com/dylanratcliffe/golinkedin
package main
import (
"encoding/json"
"os"
"github.com/dylanratcliffe/golinkedin"
)
func main() {
ln := golinkedin.New()
ln.SetCookieStr(`your_linkedin_cookies`)
profile, err := ln.ProfileByUsername("linkedin_username")
if err != nil {
panic(err.Error())
}
f, err := os.Create("profile.json")
if err != nil {
panic(err.Error())
}
if err := json.NewEncoder(f).Encode(profile); err != nil {
panic(err.Error())
}
}
package main
import (
"encoding/json"
"os"
"github.com/dylanratcliffe/golinkedin"
)
func main() {
ln := golinkedin.New()
ln.SetCookieStr(`your_linkedin_cookies`)
// search geo
geoNode, err := searchGeo(ln, "USA")
if err != nil {
panic(err.Error())
}
f, err := os.Create("geo.json")
if err != nil {
panic(err.Error())
}
if err := json.NewEncoder(f).Encode(geoNode); err != nil {
panic(err.Error())
}
}
func searchGeo(ln *golinkedin.Linkedin, keyword string) (*golinkedin.GeoNode, error) {
geoNode, err := ln.SearchGeo(keyword)
if err != nil {
panic(err.Error())
}
geos := make([]golinkedin.Geo, 0)
for geoNode.Next() {
geos = append(geos, geoNode.Elements...)
if len(geos) >= 20 {
break
}
}
geoNode.Elements = geos
return geoNode, nil
}
For now, every Node have SetLinkedin(), Error() error, and Next() bool method, except for ProfileNode
MIT
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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.