Skip to content

Commit

Permalink
Support "search_type" parameter, and allow setting custom parameters (#6
Browse files Browse the repository at this point in the history
)
  • Loading branch information
jackwh authored Mar 1, 2024
1 parent 3e5cbb5 commit 24cda98
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/LaravelScrapingBeeGoogleSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ public function search(string $query): self
return $this;
}

/**
* https://www.scrapingbee.com/documentation/google/#search_type
*/
public function searchType(string $type): self
{
$this->params['search_type'] = $type;

return $this;
}

/**
* https://www.scrapingbee.com/documentation/google/#country_code
*/
Expand Down Expand Up @@ -115,6 +125,17 @@ public function addHtml(): self
return $this;
}

/*
* If the API hasn't caught up and you need to support a new ScrapingBee parameter,
* you can set it using this method.
*/
public function setParam(string $key, mixed $value): self
{
$this->params[$key] = $value;

return $this;
}

private function reset(): self
{
$this->params = [];
Expand Down

0 comments on commit 24cda98

Please sign in to comment.