readability

package module
v0.0.0-...-c98b716 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

README

Go Readability

Go Report Card Build status

Go version of the web page extraction algorithm.

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
	Title       string
	Byline      string
	Dir         string
	Content     string
	TextContent string
	Length      int
	Excerpt     string
}

Article 解析结果

type Option

type Option struct {
	MaxNodeNum        int
	Debug             bool
	NbTopCandidates   int
	CharThreshold     int
	PageURL           string
	ClassesToPreserve []string
}

Option 解析配置

type Readability

type Readability struct {
	// contains filtered or unexported fields
}

Readability 网页正文提取

func New

func New(o Option) *Readability

New 新建一个对象

func (*Readability) Parse

func (read *Readability) Parse(s string) (*Article, error)

Parse 进行解析

Jump to

Keyboard shortcuts

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