goreadly

package module
Version: v0.0.0-...-acd0164 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2019 License: MIT Imports: 11 Imported by: 0

README

goreadly

goreadly is Go package is to makes Web pages more readable.

GoDoc

Installation

go get github.com/antchfx/goreadly

Example

package main

import (
	"fmt"
	"net/http"

	"github.com/antchfx/goreadly"
)

func main() {
	resp, _ := http.Get("https://www.engadget.com/2017/07/10/google-highlights-pirate-sites/")
	doc, err := goreadly.ParseResponse(resp)
	if err != nil {
		panic(err)
	}
	fmt.Println(doc.Title)
	fmt.Println(doc.Body)
}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// MinTextLength specified the minimum length of content.
	MinTextLength = 25
)

Functions

This section is empty.

Types

type Document

type Document struct {
	URL *url.URL

	Title, Body string
}

A Document represents an article document object.

func ParseHTML

func ParseHTML(self *url.URL, doc *html.Node) (*Document, error)

ParseResponse parses an HTTP document and convert its to readability.

func ParseResponse

func ParseResponse(res *http.Response) (*Document, error)

ParseResponse parses an HTTP document and convert its to readability.

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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