noveler

package
v0.0.0-...-b7020ef Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const Timeout = 60 * time.Second

Timeout Context 的 timeout

Variables

This section is empty.

Functions

This section is empty.

Types

type CzbooksNoveler

type CzbooksNoveler struct {
	URL string
	// contains filtered or unexported fields
}

CzbooksNoveler 小說狂人的 Noveler

func NewCzbooksNoveler

func NewCzbooksNoveler(url string) *CzbooksNoveler

NewCzbooksNoveler 建立 CzbooksNoveler

func (*CzbooksNoveler) GetChapterURLs

func (n *CzbooksNoveler) GetChapterURLs() ([]NovelChapter, error)

GetChapterURLs 獲得所有章節的網址

func (*CzbooksNoveler) GetInfo

func (n *CzbooksNoveler) GetInfo() error

GetInfo 獲得小說基本資料

func (*CzbooksNoveler) GetName

func (n *CzbooksNoveler) GetName() string

GetName 回傳目前抓取的小說名字

func (*CzbooksNoveler) GetParseResult

GetParseResult 獲得 章節的內容 & 下一頁的連結

func (*CzbooksNoveler) MergeContent

func (n *CzbooksNoveler) MergeContent(fileNames []string, fromPath, toPath string) error

MergeContent 合併章節

type HjwzwNoveler

type HjwzwNoveler struct {
	URL string
	// contains filtered or unexported fields
}

HjwzwNoveler 黃金屋的 Noveler

func NewHjwzwNoveler

func NewHjwzwNoveler(url string) *HjwzwNoveler

NewHjwzwNoveler 建立 HjwzwNoveler

func (*HjwzwNoveler) GetChapterURLs

func (n *HjwzwNoveler) GetChapterURLs() ([]NovelChapter, error)

GetChapterURLs 獲得所有章節的網址

func (*HjwzwNoveler) GetInfo

func (n *HjwzwNoveler) GetInfo() error

GetInfo 獲得小說基本資料

func (*HjwzwNoveler) GetName

func (n *HjwzwNoveler) GetName() string

GetName 回傳目前抓取的小說名字

func (*HjwzwNoveler) GetParseResult

GetParseResult 獲得 章節的內容 & 下一頁的連結

func (*HjwzwNoveler) MergeContent

func (n *HjwzwNoveler) MergeContent(fileNames []string, fromPath, toPath string) error

MergeContent 合併章節

type NovelChapter

type NovelChapter struct {
	Order string
	URL   string
}

NovelChapter 小說章節網址

func (NovelChapter) MarshalText

func (n NovelChapter) MarshalText() ([]byte, error)

MarshalText 為了 map 的 key,所以 NovelChapter 不是 pointer

func (*NovelChapter) UnmarshalText

func (n *NovelChapter) UnmarshalText(text []byte) error

UnmarshalText 為了 unmarshal 後能填入值,所以是 *NovelChapter

type NovelChapterHTML

type NovelChapterHTML struct {
	NovelChapter
	Text string
}

NovelChapterHTML 小說章節的 HTML

type Noveler

type Noveler interface {
	// 得到小說名字
	GetName() string
	// 獲得小說基本資料
	GetInfo() error
	// 獲得和所有章節的網址
	GetChapterURLs() ([]NovelChapter, error)
	// 獲得 章節的內容 下一頁的連結
	GetParseResult(req concurrencyengine.Request) (concurrencyengine.ParseResult, error)
	// 合併章節
	MergeContent(fileNames []string, fromPath, toPath string) error
	// contains filtered or unexported methods
}

Noveler 抓取小說必需的 function

type PtwxzNoveler

type PtwxzNoveler struct {
	URL string
	// contains filtered or unexported fields
}

PtwxzNoveler 飄天文學的 Noveler

func NewPtwxzNoveler

func NewPtwxzNoveler(url string) *PtwxzNoveler

NewPtwxzNoveler 建立 PtwxzNoveler

func (*PtwxzNoveler) GetChapterURLs

func (n *PtwxzNoveler) GetChapterURLs() ([]NovelChapter, error)

GetChapterURLs 獲得所有章節的網址

func (*PtwxzNoveler) GetInfo

func (n *PtwxzNoveler) GetInfo() error

GetInfo 獲得小說基本資料

func (*PtwxzNoveler) GetName

func (n *PtwxzNoveler) GetName() string

GetName 回傳目前抓取的小說名字

func (*PtwxzNoveler) GetParseResult

GetParseResult 獲得 章節的內容 & 下一頁的連結

func (*PtwxzNoveler) MergeContent

func (n *PtwxzNoveler) MergeContent(fileNames []string, fromPath, toPath string) error

MergeContent 合併章節

type UUkanshuNoveler

type UUkanshuNoveler struct {
	URL string
	// contains filtered or unexported fields
}

UUkanshuNoveler UU看書網的 Noveler

func NewUUkanshuNoveler

func NewUUkanshuNoveler(url string) *UUkanshuNoveler

NewUUkanshuNoveler 建立 UUkanshuNoveler

func (*UUkanshuNoveler) GetChapterURLs

func (n *UUkanshuNoveler) GetChapterURLs() ([]NovelChapter, error)

GetChapterURLs 獲得所有章節的網址

func (*UUkanshuNoveler) GetInfo

func (n *UUkanshuNoveler) GetInfo() error

GetInfo 獲得小說基本資料

func (*UUkanshuNoveler) GetName

func (n *UUkanshuNoveler) GetName() string

GetName 回傳目前抓取的小說名字

func (*UUkanshuNoveler) GetParseResult

GetParseResult 獲得 章節的內容 & 下一頁的連結

func (*UUkanshuNoveler) MergeContent

func (n *UUkanshuNoveler) MergeContent(fileNames []string, fromPath, toPath string) error

MergeContent 合併章節

type WanbentxtNoveler

type WanbentxtNoveler struct {
	URL string
	// contains filtered or unexported fields
}

WanbentxtNoveler 完本神站的 Noveler

func NewWanbentxtNoveler

func NewWanbentxtNoveler(url string) *WanbentxtNoveler

NewWanbentxtNoveler 建立 WanbentxtNoveler

func (*WanbentxtNoveler) GetChapterURLs

func (n *WanbentxtNoveler) GetChapterURLs() ([]NovelChapter, error)

GetChapterURLs 獲得所有章節的網址

func (*WanbentxtNoveler) GetInfo

func (n *WanbentxtNoveler) GetInfo() error

GetInfo 獲得小說基本資料

func (*WanbentxtNoveler) GetName

func (n *WanbentxtNoveler) GetName() string

GetName 回傳目前抓取的小說名字

func (*WanbentxtNoveler) GetParseResult

GetParseResult 獲得 章節的內容 & 下一頁的連結

func (*WanbentxtNoveler) MergeContent

func (n *WanbentxtNoveler) MergeContent(fileNames []string, fromPath, toPath string) error

MergeContent 合併章節

Jump to

Keyboard shortcuts

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