extractor

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2024 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExtractionPoints = map[string][]string{
	"script": {"src", "data-src"},
}

ExtractionPoints defines the default HTML tags and their attributes from which JavaScript sources are extracted.

Functions

func ExtractSources

func ExtractSources(input io.Reader, extractionPoints ...map[string][]string) (<-chan url.URL, error)

ExtractSources extracts all JavaScript sources found in the provided HTTP response reader. The optional extractionPoints can be used to overwrite the default extraction points map with a set of HTML tag names, together with a list of what attributes to extract from.

func FetchResponse

func FetchResponse(u string, method string, headers http.Header) (*http.Response, error)

FetchResponse fetches the HTTP response for the given URL.

func Filter

func Filter(input <-chan url.URL, options ...func([]url.URL) []url.URL) (<-chan url.URL, error)

Filter applies options to filter URLs from the input channel.

func WithComplete

func WithComplete(base *url.URL) func([]url.URL) []url.URL

WithComplete is an option to complete relative URLs.

func WithResolve

func WithResolve() func([]url.URL) []url.URL

WithResolve is an option to filter URLs that resolve successfully.

Types

This section is empty.

Jump to

Keyboard shortcuts

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