| @@ 238-253 (lines=16) @@ | ||
| 235 | * @param string $engine |
|
| 236 | * @return Collection |
|
| 237 | */ |
|
| 238 | public function mostFrequentDomains($siteID, $engine = 'google') |
|
| 239 | { |
|
| 240 | $response = $this->performQuery('sites/most_frequent_domains', ['id' => $siteID, 'engine' => $engine]); |
|
| 241 | ||
| 242 | $domains = collect($response['Site'])->transform(function ($site) { |
|
| 243 | return new StatFrequentDomain([ |
|
| 244 | 'domain' => array_get($site, 'Domain'), |
|
| 245 | 'top_ten_results' => array_get($site, 'TopTenResults'), |
|
| 246 | 'results_analyzed' => array_get($site, 'ResultsAnalyzed'), |
|
| 247 | 'coverage' => array_get($site, 'Coverage'), |
|
| 248 | 'analyzed_on' => array_get($site, 'AnalyzedOn'), |
|
| 249 | ]); |
|
| 250 | }); |
|
| 251 | ||
| 252 | return $domains; |
|
| 253 | } |
|
| 254 | ||
| 255 | } |
|
| 256 | ||
| @@ 126-141 (lines=16) @@ | ||
| 123 | * @param string $engine |
|
| 124 | * @return Collection |
|
| 125 | */ |
|
| 126 | public function mostFrequentDomains($tagID, $engine = 'google') |
|
| 127 | { |
|
| 128 | $response = $this->performQuery('tags/most_frequent_domains', ['id' => $tagID, 'engine' => $engine]); |
|
| 129 | ||
| 130 | $domains = collect($response['Site'])->transform(function ($site) { |
|
| 131 | return new StatFrequentDomain([ |
|
| 132 | 'domain' => array_get($site, 'Domain'), |
|
| 133 | 'top_ten_results' => array_get($site, 'TopTenResults'), |
|
| 134 | 'results_analyzed' => array_get($site, 'ResultsAnalyzed'), |
|
| 135 | 'coverage' => array_get($site, 'Coverage'), |
|
| 136 | 'analyzed_on' => array_get($site, 'AnalyzedOn'), |
|
| 137 | ]); |
|
| 138 | }); |
|
| 139 | ||
| 140 | return $domains; |
|
| 141 | } |
|
| 142 | } |
|
| 143 | ||