But you can implement this easily yourself in you extended crawler-class,
just do something like this:
classMyCrawlerextendsPHPCrawler{protected$time_limit=60;protected$start_time;functionhandleDocumentInfo($DocInfo){if($this->start_time==null)$this->start_time=time();// Set start-time// ... you normal codeif(time()-$this->start_time>$this->time_limit)return-1;// Abort crawling-process}}
And feel free to open a feature-request for a "setTimeLimit()"-option.
Last edit: Uwe Hunfeld 2014-02-28
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
View and moderate all "Help" comments posted by this user
Mark all as spam, and block user from posting to "Forum"
Is there an ability to set a limit on the amount of time spent crawling?? Crawl as many URLs as you can in say 60 secs?
Hi!
No, there isn't such an option in phpcrawl (yet).
But you can implement this easily yourself in you extended crawler-class,
just do something like this:
And feel free to open a feature-request for a "setTimeLimit()"-option.
Last edit: Uwe Hunfeld 2014-02-28
View and moderate all "Help" comments posted by this user
Mark all as spam, and block user from posting to "Forum"
Thank You so much!! Thanks for the quick reply and thanks for the code, works perfectly for what I needed.