Add search options (for EnableHighlighting, DisableLocation..)

This commit is contained in:
goferito 2016-03-13 23:35:47 +01:00
parent 2d399e4d4f
commit e2c9b5cf57
3 changed files with 4 additions and 1 deletions

View file

@ -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

View file

@ -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" : '')

View file

@ -41,7 +41,8 @@ describe("Bing Web", function () {
{
top: 5,
market: 'en-US',
adult: 'Strict'
adult: 'Strict',
options: ['DisableLocationDetection', 'EnableHighlighting']
},
function (err, res, body) {