- $this->es->markQueued($linkInfo->url);
- $this->queue->addToIndex(
- $linkInfo->url, $linkInfo->title, $linkInfo->source
- );
- if (Helper::isUrlAllowed($linkInfo->url)) {
- $this->queue->addToCrawl($linkInfo->url);
+ if ($linkInfo->crawl || $linkInfo->index) {
+ $this->es->markQueued($linkInfo->url);
+ $actions = array();
+ if ($linkInfo->index) {
+ $actions[] = 'index';
+ }
+ if ($linkInfo->crawl) {
+ $actions[] = 'crawl';
+ }
+ $this->queue->addToProcessList(
+ $linkInfo->url, $actions
+ );
+ }
+ }
+ }
+
+ protected function showLinks($linkInfos)
+ {
+ foreach ($linkInfos as $linkInfo) {
+ Log::msg($linkInfo->url);
+ if ($linkInfo->title) {
+ Log::msg(' title: ' . $linkInfo->title);
+ Log::msg(' source: ' . $linkInfo->source);
+ Log::msg(
+ ' known: ' . intval($linkInfo->known)
+ . ', crawl: ' . intval($linkInfo->crawl)
+ . ', index: ' . intval($linkInfo->index)
+ );