Skip to content

Commit

Permalink
Merge pull request #3 from dwickstrom/fix-url-generator
Browse files Browse the repository at this point in the history
Fix url generator
  • Loading branch information
David Wickström committed Dec 18, 2014
2 parents bb28c40 + 6a2acae commit ce964ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
4 changes: 2 additions & 2 deletions spec/SeoMoz/Generator/RequestUrlSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function it_generates_a_request_url()
{
$it = $this->generate('testa.se');
$it->shouldBeString();
$it->shouldStartWith('http://lsapi.seomoz.com/');
$it->shouldEndWith('3D');
$it->shouldStartWith('http://lsapi.seomoz.com/linkscape/url-metrics/testa.se');
$it->shouldEndWith('%3D');
}
}
9 changes: 1 addition & 8 deletions src/SeoMoz/Generator/RequestUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,10 @@ public function generate($domainName)
*/
private function buildUrl($domainName, $cols, $expires, $urlSafeSignature)
{
$parameters = [
"Cols" => $cols,
"AccessID" => $this->accessId,
"Expires" => $expires,
"Signature" => $urlSafeSignature
];

$parts = [
'http://lsapi.seomoz.com/linkscape/url-metrics/',
urlencode($domainName),
http_build_query($parameters)
"?Cols=".$cols."&AccessID=".$this->accessId."&Expires=".$expires."&Signature=".$urlSafeSignature
];

return implode("", $parts);
Expand Down

0 comments on commit ce964ce

Please sign in to comment.