monitor

package
v1.3.12 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChiphellMonitor

type ChiphellMonitor struct {
	ForumName     string
	Cookies       string
	UserKeywords  map[string][]string // 手机号及其关键词的映射
	Notifier      *notifier.DingTalkNotifier
	Database      *db.Database
	Logger        *mylog.Logger
	MessageQueue  chan NotificationMessage
	WaitTimeRange struct {
		Min int
		Max int
	}
	ProxyAPI string
}

func NewChiphellMonitor added in v1.1.0

func NewChiphellMonitor(forumName string, cookies string, userKeywords map[string][]string, notifier *notifier.DingTalkNotifier, database *db.Database, waitTimeRange struct{ Min, Max int }, proxyAPI string) *ChiphellMonitor

func (*ChiphellMonitor) FetchPageContent

func (c *ChiphellMonitor) FetchPageContent() (string, error)

获取页面内容 FetchPageContent 使用代理池并发请求访问论坛页面

func (*ChiphellMonitor) FetchPostMainContent added in v1.2.2

func (c *ChiphellMonitor) FetchPostMainContent(postURL string) (string, string, string, string, string, error)

func (*ChiphellMonitor) MonitorPage

func (c *ChiphellMonitor) MonitorPage()

func (*ChiphellMonitor) ParseContent

func (c *ChiphellMonitor) ParseContent(content string) ([]Post, error)

func (*ChiphellMonitor) ProcessPosts

func (c *ChiphellMonitor) ProcessPosts(posts []Post) error

type ForumMonitor

type ForumMonitor interface {
	FetchPageContent() (string, error)
	ParseContent(content string) ([]Post, error)
	ProcessPosts(posts []Post) error
	MonitorPage()
}

func NewMonitor added in v1.1.9

func NewMonitor(forumName string, cookies string, userKeywords map[string][]string, notifier *notifier.DingTalkNotifier, database *db.Database, waitTimeRange struct{ Min, Max int }, proxyapi string) ForumMonitor

type NotificationMessage added in v1.1.0

type NotificationMessage struct {
	Title         string
	Message       string
	AtPhoneNumber []string
}

type Post

type Post struct {
	Title    string
	Link     string
	Category string
}

Jump to

Keyboard shortcuts

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