fetch

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// GlobalReqTimeout is the global HTTP request timeout.
	GlobalReqTimeout = 3 * time.Second

	// GlobalRateLimiter is the global outgoing HTTP request limiter.
	GlobalRateLimiter = ratelimit.New(50)

	// CiteFormat is the citation output format.
	CiteFormat = crossref.BibTeX

	// CiteFileName is the citation filename base (w/o extension).
	CiteFileName = "citations"

	// CiteAppend controls whether the citation file will be
	// appended to or overwritten.
	CiteAppend = false

	// CiteSeparate controls whether the citations will be written to
	// separate files
	CiteSeparate = false

	// NoUserAgent controls weather to omit the User-Agent header in
	// HTTP requests.
	NoUserAgent = false
)

Functions

func CheckDOI

func CheckDOI(doi string) error

CheckDOI checks if a doi is valid (registered) by querying doi.org for a good response.

func Fetch

func Fetch(mode FetchMode, handles []string) error

Fetch downloads articles from Sci-Hub and/or citations from Crossref, from a list of supplied handles (DOIs and/or ISBNs).

Types

type FetchMode

type FetchMode int

FetchMode signifies the mode in which the Fetch function will run.

const (
	DefaultMode FetchMode = iota
	SourceMode
	CiteMode
)

Available modes of the Fetch function.

Jump to

Keyboard shortcuts

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