fetch

package
v0.5.2-beta Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsURL

func IsURL(input string) bool

IsURL checks if the input looks like a URL

Types

type FetchResult

type FetchResult struct {
	URL         string `json:"url"`
	OutputPath  string `json:"output_path"`
	Company     string `json:"company"`
	Position    string `json:"position"`
	ContentSize int    `json:"content_size"`
}

FetchResult contains the result of a fetch operation

type Fetcher

type Fetcher struct {
	Client    *http.Client
	OutputDir string
}

Fetcher handles fetching and saving job postings from URLs

func NewFetcher

func NewFetcher(outputDir string) *Fetcher

NewFetcher creates a new Fetcher instance

func (*Fetcher) ExtractJobPosting

func (f *Fetcher) ExtractJobPosting(html string, parsedURL *url.URL) (content, company, position string)

ExtractJobPosting extracts job posting content from HTML based on the job board

func (*Fetcher) Fetch

func (f *Fetcher) Fetch(rawURL string, outputName string) (*FetchResult, error)

Fetch downloads a job posting from a URL and saves it to the output directory

func (*Fetcher) FormatOutput

func (f *Fetcher) FormatOutput(content, sourceURL, company, position string) string

FormatOutput creates the final markdown output with metadata

func (*Fetcher) GenerateFilename

func (f *Fetcher) GenerateFilename(company, position string, parsedURL *url.URL) string

GenerateFilename creates a filename from company and position

Jump to

Keyboard shortcuts

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