Skip to content
This repository has been archived by the owner on Aug 24, 2020. It is now read-only.
/ readability Public archive

readability for golang. 网页文章标题和正文抽取工具

License

Notifications You must be signed in to change notification settings

ying32/readability

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

readability

readability for golang

Golang版本是根据readabiliity for node.js以及readability for python所改写,并加入了些自己的,比如支持gzip等。

引用的第三方包

github.com/PuerkitoBio/goquery
github.com/axgle/mahonia

使用方法

package main

import (
	"fmt"

	"github.com/ying32/readability"
)

func main() {
    test, err := readability.NewReadability("http://wd.leiting.com/home/news/news_detail.php?id=599")
    if err != nil {
	fmt.Println("failed.", err)
	return
    }
    test.Parse()
    fmt.Println(test.Title)
    fmt.Println(test.Content)
}

About

readability for golang. 网页文章标题和正文抽取工具

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages