linkedin

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package linkedin isolates LinkedIn-specific scraping recipes from ghostchrome's core. It provides cobra commands wired under the `ghostchrome linkedin <sub>` namespace.

Subcommands:

ghostchrome linkedin people  → People search → CSV (leads gen)
ghostchrome linkedin posts   → Content search with include/exclude
                               filters (freelance opportunity hunting)

All subcommands assume a logged-in profile (see `ghostchrome login linkedin`) and reuse ghostchrome's stealth + human-input dynamics + cookie injection.

Index

Constants

This section is empty.

Variables

View Source
var CountryURN = map[string]string{
	"FR": "105015875",
	"US": "103644278",
	"UK": "101165590",
	"GB": "101165590",
	"DE": "101282230",
	"ES": "105646813",
	"IT": "103350119",
	"NL": "102890719",
	"BE": "100565514",
	"CH": "106693272",
	"CA": "101174742",
	"PT": "100364837",
	"IE": "104738515",
	"LU": "104042105",
	"AU": "101452733",
}

CountryURN maps ISO-2 codes to LinkedIn's geographical URN integers used in the People filter `geoUrn` parameter. Stable values harvested from the public LinkedIn search dropdown.

View Source
var DatePostedURN = map[string]string{
	"24h":   `"past-24h"`,
	"day":   `"past-24h"`,
	"week":  `"past-week"`,
	"month": `"past-month"`,
}

DatePostedURN is the LinkedIn content-filter token expected by the `datePosted` URL parameter on `/search/results/content/`.

Functions

func ContentSearchURL

func ContentSearchURL(keywords, datePosted string) string

ContentSearchURL builds a Content (post) search URL for the given keywords + date filter token. `datePosted` accepts "24h", "week", "month", or "" for any.

func HasAny

func HasAny(text string, needles []string) bool

HasAny is the public helper variant.

func PeopleSearchURL

func PeopleSearchURL(keywords, countryURN string) string

PeopleSearchURL builds a People search URL for the given keywords + optional country URN.

Types

type CommandFactory

type CommandFactory struct {
	BuildBrowserOpts func() engine.BrowserOpts
	ApplyStealth     func(page interface{}) // optional, may be nil
}

CommandFactory builds the `ghostchrome linkedin ...` cobra subtree. The caller passes accessor closures for the global flags it owns (timeout, stealth, etc.) and a builder that materializes the BrowserOpts so this package stays decoupled from cmd/.

func (*CommandFactory) Register

func (f *CommandFactory) Register(parent *cobra.Command)

Register attaches the linkedin subcommand tree to the given parent.

type PeopleLeadRecord

type PeopleLeadRecord struct {
	ProfileURL string
	Slug       string
	Name       string
	Status     string // Premium / Verified / Influencer
	Connection string // 1st / 2nd / 3rd+
	Headline   string
	Location   string
}

PeopleLeadRecord is a row in the People-search CSV output.

func ParsePeopleResults

func ParsePeopleResults(text string) []PeopleLeadRecord

ParsePeopleResults extracts profile cards from a rendered extraction text. Lines that don't carry a connection-degree marker are skipped (they are duplicate inner anchors of the same card).

type PostRecord

type PostRecord struct {
	AuthorName string
	AuthorURL  string
	PostURL    string
	PostedAgo  string // "42 min", "3 h", "2 j", "1 sem"
	Text       string // truncated post body
}

PostRecord is a row in the Content-search CSV output, after include / exclude filters have been applied.

func FilterPosts

func FilterPosts(text string, include, exclude []string) []PostRecord

FilterPosts walks the rendered search-content text, splits it into per- card chunks, applies include/exclude substring filters case-insensitively, and returns the matching posts.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL