Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions src/Api/Crawl.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,19 @@ public function setObeyRobots($bool = true)

return $this;
}

/**
* Set value to 1 to force the use of proxy IPs for the crawl.
*
* @param bool $bool
* @return $this
*/
public function setUseProxies($bool = true)
{
$this->otherOptions['useProxies'] = (int)(bool)$bool;

return $this;
}

/**
* Force the start of a new crawl "round" (manually repeat the crawl).
Expand Down Expand Up @@ -488,13 +501,17 @@ public function buildUrl()
$url .= '&name=' . $this->getName();

// Add seeds
$url .= '&seeds=' . implode(' ', array_map(function ($item) {
if (!empty($this->seeds)) {
$url .= '&seeds=' . implode(' ', array_map(function ($item) {
return urlencode($item);
}, $this->seeds));
}

// Add other options
foreach ($this->otherOptions as $option => $value) {
$url .= '&' . $option . '=' . $value;
if (!empty($this->otherOptions)) {
foreach ($this->otherOptions as $option => $value) {
$url .= '&' . $option . '=' . $value;
}
}

// Add API link
Expand Down