Documentation ¶
Index ¶
- func CheckTitleWithBeauty(title string) bool
- type CK101
- func (p *CK101) Crawler(target string, workerNum int)
- func (p *CK101) GetAllImageAddress(target string) []string
- func (b *CK101) GetCurrentPageResultCount() int
- func (b *CK101) GetPostStarByIndex(postIndex int) int
- func (b *CK101) GetPostTitleByIndex(postIndex int) string
- func (b *CK101) GetPostUrlByIndex(postIndex int) string
- func (b *CK101) HasValidURL(url string) bool
- func (p *CK101) ParseCK101PageByIndex(page int) int
- type FBAlbum
- func (p *FBAlbum) Crawler(target string, workerNum int)
- func (p *FBAlbum) GetAllImageAddress(target string) []string
- func (b *FBAlbum) GetCurrentPageResultCount() int
- func (b *FBAlbum) GetPostStarByIndex(postIndex int) int
- func (b *FBAlbum) GetPostTitleByIndex(postIndex int) string
- func (b *FBAlbum) GetPostUrlByIndex(postIndex int) string
- func (b *FBAlbum) HasValidURL(url string) bool
- func (p *FBAlbum) ParseFBAlbumPageByIndex(page int) int
- type PTT
- func (p *PTT) Crawler(target string, workerNum int)
- func (p *PTT) GetAllFromURL(url string) (title string, allImages []string, like, dis int)
- func (p *PTT) GetAllImageAddress(target string) []string
- func (p *PTT) GetCurrentPageResultCount() int
- func (p *PTT) GetPostLikeDis(target string) (int, int)
- func (p *PTT) GetPostStarByIndex(postIndex int) int
- func (p *PTT) GetPostTitleByIndex(postIndex int) string
- func (p *PTT) GetPostUrlByIndex(postIndex int) string
- func (p *PTT) GetUrlTitle(target string) string
- func (b *PTT) HasValidURL(url string) bool
- func (p *PTT) ParsePttByNumber(num int, page int) int
- func (p *PTT) ParsePttPageByIndex(page int, replace bool) int
- func (p *PTT) ParseSearchByKeyword(keyword string) int
- type PostDoc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckTitleWithBeauty ¶ added in v0.3.4
CheckTitleWithBeauty: check if title contains "美女" or "美女圖" or "美女圖片" or "美女圖片"
Types ¶
type CK101 ¶
type CK101 struct { //To store current CK101 post result BaseDir string // contains filtered or unexported fields }
func (*CK101) GetAllImageAddress ¶ added in v0.3.3
GetAllImageAddress: return all image address in current page.
func (*CK101) GetCurrentPageResultCount ¶
func (b *CK101) GetCurrentPageResultCount() int
Return parse page result count, it will be 0 if you still not parse any page
func (*CK101) GetPostStarByIndex ¶
Get post like count by index in current parsed page
func (*CK101) GetPostTitleByIndex ¶
Get post title by index in current parsed page
func (*CK101) GetPostUrlByIndex ¶
Get post URL by index in current parsed page
func (*CK101) HasValidURL ¶
func (*CK101) ParseCK101PageByIndex ¶
Set CK101 board page index, fetch all post and return article count back
type FBAlbum ¶
type FBAlbum struct { //To store current FBAlbum post result BaseDir string // contains filtered or unexported fields }
func NewFBAlbum ¶
func NewFBAlbum() *FBAlbum
func (*FBAlbum) GetAllImageAddress ¶ added in v0.3.3
GetAllImageAddress: return all image address in current page.
func (*FBAlbum) GetCurrentPageResultCount ¶
func (b *FBAlbum) GetCurrentPageResultCount() int
Return parse page result count, it will be 0 if you still not parse any page
func (*FBAlbum) GetPostStarByIndex ¶
Get post like count by index in current parsed page
func (*FBAlbum) GetPostTitleByIndex ¶
Get post title by index in current parsed page
func (*FBAlbum) GetPostUrlByIndex ¶
Get post URL by index in current parsed page
func (*FBAlbum) HasValidURL ¶
func (*FBAlbum) ParseFBAlbumPageByIndex ¶
Set FBAlbum board page index, fetch all post and return article count back
type PTT ¶
type PTT struct { //Handle base folder address to store images BaseDir string SearchAddress string // contains filtered or unexported fields }
func (*PTT) GetAllFromURL ¶ added in v0.6.0
GetAllFromURL: return all post images, like and dis in current page
func (*PTT) GetAllImageAddress ¶ added in v0.3.3
GetAllImageAddress: return all image address in current page.
func (*PTT) GetCurrentPageResultCount ¶
Return parse page result count, it will be 0 if you still not parse any page
func (*PTT) GetPostStarByIndex ¶
Get post like count by index in current parsed page
func (*PTT) GetPostTitleByIndex ¶
Get post title by index in current parsed page
func (*PTT) GetPostUrlByIndex ¶
Get post URL by index in current parsed page
func (*PTT) GetUrlTitle ¶ added in v0.5.0
GetUrlTitle: return title and url of post
func (*PTT) HasValidURL ¶
func (*PTT) ParsePttByNumber ¶ added in v0.3.6
Set Ptt board psot number, fetch assigned (at least) number of posts. Return real number.
func (*PTT) ParsePttPageByIndex ¶
Set Ptt board page index, fetch all post and return article count back
func (*PTT) ParseSearchByKeyword ¶ added in v0.7.0
Search with specific keyword, fetch all post and return article count back
type PostDoc ¶ added in v0.3.5
type PostDoc struct { ArticleID string `json:"article_id" bson:"article_id"` ArticleTitle string `json:"article_title" bson:"article_title"` Author string `json:"author" bson:"author"` Date string `json:"date" bson:"date"` URL string `json:"url" bson:"url"` ImageLinks []string `json:"image_links" bson:"image_links"` Likeint int `json:"likeint" bson:"likeint"` Dislikeint int `json:"dislikeint" bson:"dislikeint"` }