readability

package module
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2019 License: MIT Imports: 18 Imported by: 0

README

readability

readability is a Go package that cleans a HTML page from clutter like buttons, ads and background images, and changes the page's text size, contrast and layout for better readability.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Article

type Article struct {
	URL        string
	Meta       Metadata
	Content    string
	RawContent string
}

Article is the content of an URL

func FromReader

func FromReader(reader io.Reader, url *nurl.URL) (Article, error)

FromReader get readable content from the specified io.Reader

func FromURL

func FromURL(url *nurl.URL, timeout time.Duration) (Article, error)

FromURL get readable content from the specified URL

type Metadata

type Metadata struct {
	Title         string
	Image         string
	Excerpt       string
	Author        string
	MinReadTime   int
	MaxReadTime   int
	AMPURL        string
	CanonicalURL  string
	PublishedDate struct {
		Raw    string
		Parsed time.Time
	}
}

Metadata is metadata of an article

Jump to

Keyboard shortcuts

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