Documentation ¶
Index ¶
- Variables
- func InitBS(fileName string)
- func InitShelf(fileName string)
- func SortSearchOutput(so SearchOutput) []string
- type Book
- func (b *Book) DownloadCover(coverPath string) error
- func (b *Book) FromCache(bookPath string) error
- func (b *Book) FromURL(bookURL string) error
- func (b *Book) GetAuthor() string
- func (b *Book) GetBookSource() *BookSource
- func (b *Book) GetChapterList(offset, limit int) []*Chapter
- func (b *Book) GetChapterURL() string
- func (b *Book) GetCoverURL() string
- func (b *Book) GetIntroduce() string
- func (b *Book) GetName() string
- func (b *Book) GetOrigin() string
- func (b Book) String() string
- func (b *Book) UpdateChapterList(startFrom int) error
- type BookShelf
- type BookSource
- type Chapter
- type Items
- type SearchOutput
- type SearchResult
- type ShelfItem
- type SourceRule
- type UnixTime
Constants ¶
This section is empty.
Variables ¶
View Source
var BSCache *cache.Cache = cache.New(0, 0)
View Source
var Shelf = &BookShelf{}
Functions ¶
func SortSearchOutput ¶
func SortSearchOutput(so SearchOutput) []string
Types ¶
type Book ¶
type Book struct { Tag string `json:"tag"` Origin string `json:"origin"` Name string `json:"name"` Author string `json:"author"` BookmarkList []interface{} `json:"bookmarkList"` ChapterURL string `json:"chapterUrl"` // BookURL string `json:"book_url"` CoverURL string `json:"coverUrl"` Kind string `json:"kind"` LastChapter string `json:"lastChapter"` FinalRefreshDate UnixTime `json:"finalRefreshData"` // typo here NoteURL string `json:"noteUrl"` Introduce string `json:"introduce"` ChapterList []*Chapter `json:"chapterList"` BookSourceInst *BookSource `json:"-"` Page *goquery.Document `json:"-"` }
func (*Book) DownloadCover ¶
func (*Book) GetBookSource ¶
func (b *Book) GetBookSource() *BookSource
func (*Book) GetChapterList ¶
func (*Book) GetChapterURL ¶
func (*Book) GetCoverURL ¶
func (*Book) GetIntroduce ¶
func (*Book) UpdateChapterList ¶
type BookSource ¶
type BookSource struct { BookSourceGroup string `json:"bookSourceGroup"` BookSourceName string `json:"bookSourceName"` BookSourceURL string `json:"bookSourceUrl"` CheckURL string `json:"checkUrl"` Enable bool `json:"enable"` HTTPUserAgent string `json:"httpUserAgent"` RuleBookAuthor string `json:"ruleBookAuthor"` RuleBookContent string `json:"ruleBookContent"` RuleBookName string `json:"ruleBookName"` RuleChapterList string `json:"ruleChapterList"` RuleChapterName string `json:"ruleChapterName"` RuleChapterURL string `json:"ruleChapterUrl"` RuleChapterURLNext string `json:"ruleChapterUrlNext"` RuleContentURL string `json:"ruleContentUrl"` RuleCoverURL string `json:"ruleCoverUrl"` RuleFindURL string `json:"ruleFindUrl"` RuleIntroduce string `json:"ruleIntroduce"` RuleSearchAuthor string `json:"ruleSearchAuthor"` RuleSearchCoverURL string `json:"ruleSearchCoverUrl"` RuleSearchKind string `json:"ruleSearchKind"` RuleSearchLastChapter string `json:"ruleSearchLastChapter"` RuleSearchList string `json:"ruleSearchList"` RuleSearchName string `json:"ruleSearchName"` RuleSearchNoteURL string `json:"ruleSearchNoteUrl"` RuleSearchURL string `json:"ruleSearchUrl"` SerialNumber int `json:"serialNumber"` Weight int `json:"weight"` }
func GetBookSourceByURL ¶
func GetBookSourceByURL(url string) *BookSource
func (*BookSource) SearchBook ¶
func (b *BookSource) SearchBook(title string) []*Book
例:http://www.gxwztv.com/search.htm?keyword=searchKey&pn=searchPage-1 - ?为get @为post - searchKey为关键字标识,运行时会替换为搜索关键字, - searchPage,searchPage-1为搜索页数,从0开始的用searchPage-1, - page规则还可以写成 {index(第一页), indexSecond(第二页), indexThird(第三页), index-searchPage+1 或 index-searchPage-1 或 index-searchPage} - 要添加转码编码在最后加 |char=gbk - |char=escape 会模拟js escape方法进行编码 如果搜索结果可能会跳到简介页请填写简介页url正则
func (BookSource) String ¶
func (bs BookSource) String() string
type Chapter ¶
type Chapter struct { BookSourceSite string `json:"source"` BookSourceInst *BookSource `json:"-"` Content string `json:"content"` ChapterTitle string `json:"title"` Read bool `json:"is_read"` ChapterURL string `json:"url"` Index int `json:"index"` BelongToBook *Book `json:"-"` Page *goquery.Document `json:"-"` }
func (*Chapter) GetBookSource ¶
func (c *Chapter) GetBookSource() *BookSource
func (*Chapter) GetContent ¶
type SearchOutput ¶
func SearchBooks ¶
func SearchBooks(title string) SearchOutput
type SearchResult ¶
type ShelfItem ¶
type ShelfItem struct { AllowUpdate bool `json:"allowUpdate"` // 是否允许更新 BookInfoBean *Book `json:"bookInfoBean"` // 书籍信息 ChapterListSize int `json:"chapterListSize"` // 章节数 DurChapter int `json:"durChapter"` // 在读章节index DurChapterName string `json:"durChapterName"` // 在读章节名字 DurChapterPage int `json:"durChapterPage"` // 在读章节页数 FinalDate UnixTime `json:"finalDate"` // 最后阅读时间? FinalRefreshDate UnixTime `json:"finalRefreshData"` // 最后更新时间 "阅读"有typo,这里应该是 finalRefreshDate Group int `json:"group"` // 分组 HasUpdate bool `json:"hasUpdate"` IsLoading bool `json:"isLoading"` LastChapterName string `json:"lastChapterName"` NewChapters int `json:"newChapters"` NoteURL string `json:"noteUrl"` SerialNumber int `json:"serialNumber"` Tag string `json:"tag"` UseReplaceRule bool `json:"useReplaceRule"` }
type SourceRule ¶
Click to show internal directories.
Click to hide internal directories.