From 694e21b49fb8997acdb366245a8780bc4549127e Mon Sep 17 00:00:00 2001 From: tegansnyder Date: Wed, 30 Nov 2016 09:43:20 -0600 Subject: [PATCH] add url report url --- src/Api/Crawl.php | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/Api/Crawl.php b/src/Api/Crawl.php index 55f1528..b0a5a48 100644 --- a/src/Api/Crawl.php +++ b/src/Api/Crawl.php @@ -521,6 +521,42 @@ public function buildUrl() return $url; } + /** + * Sets the request type to "urls" to retrieve the URL Report + * URL for understanding diagnostic data of URLs + * + * @return $this + */ + public function getUrlReportUrl($num = null) + { + $this->otherOptions['type'] = 'urls'; + + if (!empty($num) && is_numeric($num)) { + $this->otherOptions['num'] = $num; + } + + // Setup data endpoint + $url = $this->apiUrl . '/data'; + + // Add token + $url .= '?token=' . $this->diffbot->getToken(); + + if ($this->getName()) { + // Add name + $url .= '&name=' . $this->getName(); + + // Add other options + if (!empty($this->otherOptions)) { + foreach ($this->otherOptions as $option => $value) { + $url .= '&' . $option . '=' . $value; + } + } + } + + return $url; + + } + /** * @return string */