diff --git a/README.md b/README.md index a2cd720..26b5ec4 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ var Bing = require('node-bing-api')({ accKey: "your-account-key" }); Bing.web("Pizza", { top: 10, // Number of results (max 50) skip: 3, // Skip first 3 results + options: ['DisableLocationDetection', 'EnableHighlighting'] }, function(error, res, body){ // body has more useful information, but for this example we are just diff --git a/lib/bing.js b/lib/bing.js index 3e77b50..55a21c8 100644 --- a/lib/bing.js +++ b/lib/bing.js @@ -76,6 +76,7 @@ var Bing = function (options) { + "?$format=json&" + qs.stringify({ "Query": "'" + query + "'" }) + "&$top=" + opts.top + "&$skip=" + opts.skip + + "&Options=%27" + (opts.options || []).join('%2B') + "%27" + (opts.sources ? "&Sources=%27" + opts.sources + "%27" : '') + (opts.newsSortBy ? "&NewsSortBy=%27" + opts.newsSortBy + "%27" : '') + (opts.newsCategory ? "&NewsCategory=%27" + opts.newsCategory + "%27" : '') diff --git a/test/integration.js b/test/integration.js index b8c654e..46d8e50 100644 --- a/test/integration.js +++ b/test/integration.js @@ -41,7 +41,8 @@ describe("Bing Web", function () { { top: 5, market: 'en-US', - adult: 'Strict' + adult: 'Strict', + options: ['DisableLocationDetection', 'EnableHighlighting'] }, function (err, res, body) {