func launchScheduler(db *mgo.Database, settings *Settings) { scheduler := schedulers.NewBasicScheduler() scheduler.Handle(hubspider.New(db, settings.Languages)).Every(12 * time.Hour) log.Fatal(scheduler.Start()) }
func main() { wikiHTMLSpider := &WikipediaHTMLSpider{"Albert Einstein"} wikiJSONSpider := &WikipediaJSONSpider{"Lionel Messi"} s := schedulers.NewBasicScheduler() s.Handle(wikiHTMLSpider).Every(30 * time.Second) s.Handle(wikiJSONSpider).Every(20 * time.Second) s.Start() }