lib/blekko-search/search.rb in blekko-search-0.0.6 vs lib/blekko-search/search.rb in blekko-search-0.0.7
- old
+ new
@@ -22,11 +22,11 @@
end
def search
page_number = 0
number_of_searches.times do
- response = JSON.load(blekko.request(url(page_number)))
+ response = JSON.load(blekko.request(path(page_number)))
if response['RESULT']
self.results += response['RESULT'].collect { |r| Blekko::SearchResult.new(r) }
else
return results
end
@@ -58,10 +58,14 @@
def params(page_number)
[page_size_param, auth_param, page_number_param(page_number)].compact.join("&")
end
def url(page_number)
- blekko.protocol + blekko.host + PREFIX + escaped_query + RESPONSE_FORMAT + params(page_number)
+ blekko.protocol + blekko.host + path(page_number)
+ end
+
+ def path(page_number)
+ PREFIX + escaped_query + RESPONSE_FORMAT + params(page_number)
end
def web_url
blekko.protocol + blekko.host + PREFIX + escaped_query
end
\ No newline at end of file