func (self *crawler) Init(sp *spider.Spider) Crawler { self.srcManage = 0 self.Spider = sp scheduler.Sdl.RegSpider(sp.GetId()) self.Pipeline.Init(sp) return self }
func NewGUISpider(sp *spider.Spider, idx int) *GUISpider { return &GUISpider{ Spider: sp, Title: sp.GetName(), Description: sp.GetDescription(), Index: idx, } }
func (self *crawler) Init(sp *spider.Spider) Crawler { self.Spider = sp.ReqmatrixInit() self.Pipeline = pipeline.New(sp) self.pause[0] = cache.Task.Pausetime / 2 if self.pause[0] > 0 { self.pause[1] = self.pause[0] * 3 } else { self.pause[1] = 1 } return self }
func (self *crawler) Init(sp *spider.Spider) Crawler { self.Spider = sp.ReqmatrixInit() self.Pipeline.Init(sp) self.basePause = cache.Task.Pausetime / 2 if self.basePause > 0 { self.gainPause = self.basePause * 3 } else { self.gainPause = 1 } return self }