gobook

package
v0.0.0-...-01a1fb0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusSerial = iota // 0
	StatusFinished
)

Variables

This section is empty.

Functions

func GetLocationUrl

func GetLocationUrl(rawurl string) (string, error)

获取重定向之后的 URL

func GetOpenGraphProtocol

func GetOpenGraphProtocol(tag, html string) string

获取 Open Graph Protocol

func GetOriginalUrlFromBaiduLink(source *Source, wg *sync.WaitGroup)

Types

type Book

type Book struct {
	URL          string `json:"url"`
	Name         string `json:"name"`
	Author       string `json:"author"`
	Cover        string `json:"cover"`
	Category     string `json:"category"`
	Summary      string `json:"summary"`
	ChapterCount int    `json:"chapter_count"`
	ReadURL      string `json:"read_url"`
	Status       int    `json:"status"`
}

func GetBook

func GetBook(url string) *Book

func GetBookByOGP

func GetBookByOGP(url, html string) *Book

type Chapter

type Chapter struct {
	Title string `json:"title"`
	Body  string `json:"body"`
	URL   string `json:"url"`
}

func GetChapter

func GetChapter(html, url string) *Chapter

func GetChapterByURL

func GetChapterByURL(url string) (*Chapter, error)

func GetChapters

func GetChapters(s, u string) []*Chapter

func GetChaptersFromURL

func GetChaptersFromURL(url string) (urls []*Chapter)

type Source

type Source struct {
	Title string `json:"title"`
	URL   string `json:"url"`
}

func GetSourcesByBaidu

func GetSourcesByBaidu(name string) ([]*Source, error)

func GetSourcesFromBing

func GetSourcesFromBing(name string) ([]*Source, error)

Jump to

Keyboard shortcuts

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