Support for Markets
This commit is contained in:
parent
d4f6a404d9
commit
765c9438d5
1 changed files with 11 additions and 5 deletions
|
@ -61,7 +61,8 @@ var Bing = function( options ) {
|
|||
+ "?$format=json&"
|
||||
+ qs.stringify({ "Query": "'" + query + "'" })
|
||||
+ "&$top=" + opts.top
|
||||
+ "&$skip=" + opts.skip;
|
||||
+ "&$skip=" + opts.skip
|
||||
+ (opts.market ? "&Market=%27" + opts.market + "%27" : '');
|
||||
|
||||
request({
|
||||
uri: reqUri,
|
||||
|
@ -77,10 +78,15 @@ var Bing = function( options ) {
|
|||
|
||||
}, function(err, res, body){
|
||||
|
||||
if(res.statusCode !== 200){
|
||||
err = new Error(body);
|
||||
}else{
|
||||
|
||||
// Parse body, if body
|
||||
body = typeof body === 'string'
|
||||
? JSON.parse(body)
|
||||
: body;
|
||||
}
|
||||
|
||||
callback(err, res, body);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue