collect_source_html:
www_yunjiema_top:
# host
host: "https://www.yunjiema.top"
# timed task
cron: "2 * * * *"
# Locate the keywords of the general text message content, choose one of multiple keywords
keywords:
- "500px"
- "[视觉**]"
# Regular expression to extract captcha
compile_regex: "\\d{6,}"
run
// sms-auto-regist\example\main.go
// initialization
collect.NewCollect(
collect.SetConfigPath("../config.yml"),
)
// start app
app.Run(&app.Example{})
// Start the crawler scheduled task
job(
www_yunjiema_top.NewCollect(conf.Global.CollectSourceHtml.WwwYunjiemaTop),
)
receive
for {
select {
case tel := <-collect.SendFindTel:
fmt.Printf("Find the crawled mobile phone number %s:\n", tel)
case tel := <-collect.SendFindSMSTel:
fmt.Printf("Find the phone number that sent the text message%s:\n", tel)
}
}
// sms-auto-regist\collect\collect.go
type Job interface
// sms-auto-regist\collect\origin\www_yunjiema_top\html.go
type Collect struct {
config conf.DefaultCollectConfig
}
func NewCollect(config conf.DefaultCollectConfig) *Collect {
return &Collect{
config: config,
}
}
func (c *Collect) Run() {
...
}
func (c *Collect) GetConfig() conf.DefaultCollectConfig {
return c.config
}
// Send the crawled mobile phone number to the pipeline
collect.WriteFindTel(tel)
// Send the SMS received by crawling the mobile phone number to the pipeline
collect.WriteFindSMSTel(*collect.FindSMSTel)