diff --git a/README.md b/README.md index 2007271..40884a8 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,10 @@ Bing.video("monkey vs frog", { videofilters: { duration: 'short', resolution: 'high' - } + }, + videoSortBy: 'Date' // Choices are: + // Date + // Relevance }, function(error, res, body){ console.log(body); }); diff --git a/lib/bing.js b/lib/bing.js index 9414b9f..2f12905 100644 --- a/lib/bing.js +++ b/lib/bing.js @@ -75,6 +75,7 @@ var Bing = function (options) { + (opts.imagefilters ? '&' + qs.stringify({ "ImageFilters": "'" + opts.imagefilters + "'" }) : '') + + (opts.videoSortBy ? "&VideoSortBy=%27" + opts.videoSortBy + "%27" : '') + (opts.videofilters ? '&' + qs.stringify({ "VideoFilters": "'" + opts.videofilters + "'" }) : ''); diff --git a/package.json b/package.json index d89c75b..881cd94 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-bing-api", - "version": "2.0.0", + "version": "2.1.0", "description": "Node.js module for the Azure Bing Search API", "main": "index.js", "author": "Mr. Goferito", diff --git a/test/integration.js b/test/integration.js index 00ad669..205169a 100644 --- a/test/integration.js +++ b/test/integration.js @@ -147,7 +147,8 @@ describe("Bing Video", function () { videofilters: { duration: 'short', resolution: 'high' - } + }, + videoSortBy: 'Date' }, function (err, res, body) {