bing-search-api
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -22,2 +22,12 @@ var request = require('request'); | ||
}; | ||
var parametersAvailableToAll = ['Query', '$top', '$skip', '$format', 'Market', 'Latitude', 'Longitude', 'Options']; | ||
this.availableParameters = { | ||
Web: parametersAvailableToAll.concat(['WebFileType', 'WebSearchOptions']), | ||
Image: parametersAvailableToAll.concat(['ImageFilters']), | ||
Video: parametersAvailableToAll.concat(['VideoFilters','VideoSortBy']), | ||
News: parametersAvailableToAll.concat(['NewsCategory','NewsLocationOverride','NewsSortBy']), | ||
Spell: parametersAvailableToAll.concat([]), | ||
Related: parametersAvailableToAll.concat([]) | ||
}; | ||
} | ||
@@ -37,11 +47,11 @@ | ||
var service = service || self.defaultService; | ||
var parameters = _.extend(self.defaultParameters, parameters); | ||
var combinedParameters = _.extend(self.defaultParameters, _.pick(parameters, self.availableParameters[service])); | ||
parameters.Query = q; | ||
parameters.Query = quote(parameters.Query); | ||
parameters.Market = quote(parameters.Market); | ||
combinedParameters.Query = q; | ||
combinedParameters.Query = quote(combinedParameters.Query); | ||
combinedParameters.Market = quote(combinedParameters.Market); | ||
var defaultRequest = { | ||
url: self.options.rootUri + service, | ||
qs: parameters, | ||
qs: combinedParameters, | ||
auth: { | ||
@@ -48,0 +58,0 @@ user: self.options.accountKey, |
{ | ||
"name": "bing-search-api", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Node.js Bing Search Api Client", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6347
114