site

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2019 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Sitepool = []SiteA{
	qidian,
	wwww81newcom,
	dingdian,
	biquge1,
	biquge2,
	biquge3,
}

Functions

func BookInfo

func BookInfo(BookURL string) (s *store.Store, err error)

BookInfo 获取小说信息

func Chapter

func Chapter(BookURL string) (content []string, err error)

Chapter 获取小说章节内容

func ChromedpBookInfo

func ChromedpBookInfo(BookURL string, logfile string) (s *store.Store, err error)

func ClosePhantomJS

func ClosePhantomJS()

func InitPhantomJS

func InitPhantomJS()

func PhBookInfo

func PhBookInfo(BookURL string) (s *store.Store, err error)

func PhChapter

func PhChapter(BookURL string) (content []string, err error)

func SingleSpace

func SingleSpace(s string) (r string)

Types

type ChaperSearchResult

type ChaperSearchResult struct {
	BookName string
	Author   string
	BookURL  string
}
func Search(s string) (result []ChaperSearchResult, err error)

type ErrMethodMissing

type ErrMethodMissing struct {
	Site *SiteA
}

func (ErrMethodMissing) Error

func (e ErrMethodMissing) Error() string

type ErrUnsupportSite

type ErrUnsupportSite struct {
	Site string
}

func (ErrUnsupportSite) Error

func (e ErrUnsupportSite) Error() string

type SiteA

type SiteA struct {
	Name     string // 站点名称
	HomePage string // 站点首页

	// match url, look that https://godoc.org/path#Match
	Match []string

	// search book on site
	Search func(s string) (result []ChaperSearchResult, err error)

	// parse fiction info by page body
	BookInfo func(body io.Reader) (s *store.Store, err error)

	// parse fiction chaper content by page body
	Chapter func(body io.Reader) (content []string, err error)
}

func MatchOne

func MatchOne(pool []SiteA, u string) (*SiteA, error)

MatchOne match one site, is use `MatchSites` first result

func MatchSites

func MatchSites(pool []SiteA, u string) ([]SiteA, error)

MatchSites match all site

Jump to

Keyboard shortcuts

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